From cd7d715ad35d1eec8e6f7476063163a641bb1ac8 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Mon, 12 Feb 2024 17:54:10 -0500 Subject: [PATCH] FIX: there were errors with the last merge commit . Fix it. --- rocketpy/mathutils/function.py | 3 +++ rocketpy/simulation/flight.py | 20 -------------------- rocketpy/tools.py | 1 + tests/unit/test_solidmotor.py | 2 +- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/rocketpy/mathutils/function.py b/rocketpy/mathutils/function.py index ac6bc231e..e8b6a9318 100644 --- a/rocketpy/mathutils/function.py +++ b/rocketpy/mathutils/function.py @@ -112,6 +112,9 @@ def __init__( """ if inputs is None: inputs = ["Scalar"] + if outputs is None: + outputs = ["Scalar"] + inputs, outputs, interpolation, extrapolation = self._check_user_input( source, inputs, outputs, interpolation, extrapolation ) diff --git a/rocketpy/simulation/flight.py b/rocketpy/simulation/flight.py index b2d86fd96..326b5db04 100644 --- a/rocketpy/simulation/flight.py +++ b/rocketpy/simulation/flight.py @@ -2070,11 +2070,6 @@ def w3(self): """Rocket angular velocity ω3 as a Function of time.""" return self.solution_array[:, [0, 13]] - @funcify_method("Time (s)", "Altitude (m)", "spline", "zero") - def altitude(self): - """Rocket altitude above ground level (AGL) as a Function of time.""" - return self.z - self.env.elevation - # Process second type of outputs - accelerations components @funcify_method("Time (s)", "Ax (m/s²)", "spline", "zero") def ax(self): @@ -2921,21 +2916,6 @@ def get_controller_observed_variables(self): else observed_variables ) - @cached_property - def get_controller_observed_variables(self): - """Retrieve the observed variables related to air brakes from the - controllers. If there is only one set of observed variables, it is - returned as a list. If there are multiple sets, the list containing - all sets is returned.""" - observed_variables = [ - controller.observed_variables for controller in self._controllers - ] - return ( - observed_variables[0] - if len(observed_variables) == 1 - else observed_variables - ) - @cached_property def __calculate_rail_button_forces(self): """Calculate the forces applied to the rail buttons while rocket is diff --git a/rocketpy/tools.py b/rocketpy/tools.py index cc5d0105c..8ae7d7e06 100644 --- a/rocketpy/tools.py +++ b/rocketpy/tools.py @@ -1,5 +1,6 @@ import importlib import importlib.metadata +import math import re from bisect import bisect_left diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index bdfeae58b..831ab503d 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -67,7 +67,7 @@ def test_evaluate_inertia_33_asserts_extreme_values(cesaroni_m1670): grain_mass = grain_vol * GRAIN_DENSITY grain_I_33_initial = ( - grain_mass * (1 / 2.0) * (grain_initial_inner_radius**2 + grain_outer_radius**2) + grain_mass * (1 / 2.0) * (GRAIN_INITIAL_INNER_RADIUS**2 + GRAIN_OUTER_RADIUS**2) ) # not passing because I_33 is not discrete anymore