Skip to content

Commit

Permalink
BUG: TypeError: 'numpy.float32' object is not
Browse files Browse the repository at this point in the history
iterable when getting gravity values
  • Loading branch information
Gui-FernandesBR committed Oct 9, 2023
1 parent 9ef8777 commit 44d00c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rocketpy/prints/environment_prints.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ def gravity_details(self):
-------
None
"""
surface_gravity = self.environment.gravity(self.environment.elevation)
elevation = self.environment.elevation
max_expected_height = self.environment.max_expected_height
surface_gravity = self.environment.gravity([elevation])
ceiling_gravity = self.environment.gravity([max_expected_height])
print("\nGravity Details\n")
print(f"Acceleration of gravity at surface level: {surface_gravity:9.4f} m/s²")
print(
f"Acceleration of gravity at {self.environment.max_expected_height/1000:7.3f} km (ASL): {self.environment.gravity(self.environment.max_expected_height):.4f} m/s²"
f"Acceleration of gravity at {max_expected_height/1000:7.3f} km (ASL): {ceiling_gravity:.4f} m/s²"
)
return None

Expand Down

0 comments on commit 44d00c1

Please sign in to comment.