From a110794ee142d49729bd41bea118b884ebe765cf Mon Sep 17 00:00:00 2001 From: Giovani Hidalgo Ceotto Date: Tue, 21 Nov 2023 00:42:36 -0300 Subject: [PATCH 1/4] FIX: remove double sign correction for static margin --- rocketpy/rocket/rocket.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rocketpy/rocket/rocket.py b/rocketpy/rocket/rocket.py index fd69f25d2..947c82acd 100644 --- a/rocketpy/rocket/rocket.py +++ b/rocketpy/rocket/rocket.py @@ -543,7 +543,6 @@ def evaluate_static_margin(self): self.static_margin.set_source( lambda time: (self.center_of_mass(time) - self.cp_position(0)) / (2 * self.radius) - * self._csys ) # Change sign if coordinate system is upside down self.static_margin *= self._csys From a08790b3374208e8f0bce50c9d7c6c90a26d75f8 Mon Sep 17 00:00:00 2001 From: Giovani Hidalgo Ceotto Date: Tue, 21 Nov 2023 00:43:55 -0300 Subject: [PATCH 2/4] REL: Bump version to 1.1.1 --- docs/conf.py | 2 +- docs/user/installation.rst | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b964c5fc3..9331a2f41 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ author = "RocketPy Team" # The full version, including alpha/beta/rc tags -release = "1.1.0" +release = "1.1.1" # -- General configuration --------------------------------------------------- diff --git a/docs/user/installation.rst b/docs/user/installation.rst index 25a224c72..8454156ca 100644 --- a/docs/user/installation.rst +++ b/docs/user/installation.rst @@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins .. code-block:: shell - pip install rocketpy==1.1.0 + pip install rocketpy==1.1.1 Optional Installation Method: ``conda`` diff --git a/setup.py b/setup.py index 414a27b74..85e184a02 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setuptools.setup( name="rocketpy", - version="1.1.0", + version="1.1.1", install_requires=necessary_require, extras_require={ "env_analysis": env_analysis_require, From b16ac875a2e569d78e50c69ef38792215af5054a Mon Sep 17 00:00:00 2001 From: Giovani Hidalgo Ceotto Date: Tue, 21 Nov 2023 01:15:43 -0300 Subject: [PATCH 3/4] TST: fixes test that checks coordinate systems --- tests/test_rocket.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/test_rocket.py b/tests/test_rocket.py index 160ab9aa4..3d257a6d8 100644 --- a/tests/test_rocket.py +++ b/tests/test_rocket.py @@ -51,7 +51,7 @@ def test_coordinate_system_orientation( burn_time=3.9, dry_mass=1.815, dry_inertia=(0.125, 0.125, 0.002), - center_of_dry_mass_position=0.317, + center_of_dry_mass_position=-0.317, nozzle_position=0, grain_number=5, grain_density=1815, @@ -60,7 +60,7 @@ def test_coordinate_system_orientation( grain_separation=5 / 1000, grain_outer_radius=33 / 1000, grain_initial_height=120 / 1000, - grains_center_of_mass_position=0.397, + grains_center_of_mass_position=-0.397, grain_initial_inner_radius=15 / 1000, interpolation_method="linear", coordinate_system_orientation="combustion_chamber_to_nozzle", @@ -81,7 +81,7 @@ def test_coordinate_system_orientation( rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_nose_cone, 1.160) rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_trapezoidal_fins, -1.168) - static_margin_tail_to_nose = rocket_tail_to_nose.static_margin(0) + static_margin_tail_to_nose = rocket_tail_to_nose.static_margin rocket_nose_to_tail = Rocket( radius=0.0635, @@ -98,13 +98,9 @@ def test_coordinate_system_orientation( rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_nose_cone, -1.160) rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_trapezoidal_fins, 1.168) - static_margin_nose_to_tail = rocket_nose_to_tail.static_margin(0) + static_margin_nose_to_tail = rocket_nose_to_tail.static_margin - assert ( - rocket_tail_to_nose.all_info() == None - or rocket_nose_to_tail.all_info() == None - or not abs(static_margin_tail_to_nose - static_margin_nose_to_tail) < 0.0001 - ) + assert np.array_equal(static_margin_tail_to_nose, static_margin_nose_to_tail) @patch("matplotlib.pyplot.show") From f3988751189164ae12ae58f666a0f3988394c16a Mon Sep 17 00:00:00 2001 From: Giovani Hidalgo Ceotto Date: Tue, 21 Nov 2023 11:41:21 -0300 Subject: [PATCH 4/4] MNT: Remove unnecessary matplotlib mock show --- tests/test_rocket.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_rocket.py b/tests/test_rocket.py index 3d257a6d8..acb131e1c 100644 --- a/tests/test_rocket.py +++ b/tests/test_rocket.py @@ -25,9 +25,8 @@ def test_aero_surfaces_infos( assert calisto_trapezoidal_fins.draw() == None -@patch("matplotlib.pyplot.show") def test_coordinate_system_orientation( - mock_show, calisto_nose_cone, cesaroni_m1670, calisto_trapezoidal_fins + calisto_nose_cone, cesaroni_m1670, calisto_trapezoidal_fins ): """Test if the coordinate system orientation is working properly. This test basically checks if the static margin is the same for the same rocket with @@ -35,8 +34,6 @@ def test_coordinate_system_orientation( Parameters ---------- - mock_show : mock - Mock of matplotlib.pyplot.show calisto_nose_cone : rocketpy.NoseCone Nose cone of the rocket cesaroni_m1670 : rocketpy.SolidMotor