From 44d00c1c0a9604fbd8d6c2a92feb666700153077 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Mon, 9 Oct 2023 00:37:00 -0300 Subject: [PATCH] BUG: TypeError: 'numpy.float32' object is not iterable when getting gravity values --- rocketpy/prints/environment_prints.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rocketpy/prints/environment_prints.py b/rocketpy/prints/environment_prints.py index d982066a0..9968c984b 100644 --- a/rocketpy/prints/environment_prints.py +++ b/rocketpy/prints/environment_prints.py @@ -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