From a5f67b40808054b41aaba903436649e853cf2d78 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Tue, 4 Mar 2025 22:20:23 -0300 Subject: [PATCH 1/3] DOC: add reference for reshaping thrust curve in documentation and improve method docstring --- docs/user/motors/thrust.rst | 2 ++ rocketpy/motors/motor.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/user/motors/thrust.rst b/docs/user/motors/thrust.rst index cbe327032..4359023b6 100644 --- a/docs/user/motors/thrust.rst +++ b/docs/user/motors/thrust.rst @@ -164,6 +164,8 @@ class also supports them. Let's see how to use it. ) solid_lambda.info() +.. _reshaping_thrust_curve: + Reshaping and interpolating the thrust curve -------------------------------------------- diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index cad0a60f4..c5ae276e8 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -878,7 +878,8 @@ def propellant_I_23(self): def reshape_thrust_curve(thrust, new_burn_time, total_impulse): """Transforms the thrust curve supplied by changing its total burn time and/or its total impulse, without altering the - general shape of the curve. + general shape of the curve. This method does not mutate the original + object, it only returns a new thrust curve Parameters ---------- @@ -893,6 +894,11 @@ def reshape_thrust_curve(thrust, new_burn_time, total_impulse): ------- Function Reshaped thrust curve. + + See Also + -------- + See :ref:`_reshaping_thrust_curve` for examples on how to use this + reshaping method. """ # Retrieve current thrust curve data points time_array, thrust_array = thrust.x_array, thrust.y_array From fbee7194ba8c1130a9f1ce433e85dbd2f4dc57ea Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Fri, 14 Mar 2025 15:58:57 -0300 Subject: [PATCH 2/3] MNT: fix broken ref --- rocketpy/motors/motor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index c5ae276e8..5f4b0dc0b 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -879,7 +879,7 @@ def reshape_thrust_curve(thrust, new_burn_time, total_impulse): """Transforms the thrust curve supplied by changing its total burn time and/or its total impulse, without altering the general shape of the curve. This method does not mutate the original - object, it only returns a new thrust curve + object, it only returns a new thrust curve. Parameters ---------- @@ -895,10 +895,9 @@ def reshape_thrust_curve(thrust, new_burn_time, total_impulse): Function Reshaped thrust curve. - See Also - -------- - See :ref:`_reshaping_thrust_curve` for examples on how to use this - reshaping method. + Tip + --- + See the User Guide page for examples on how to use this method. """ # Retrieve current thrust curve data points time_array, thrust_array = thrust.x_array, thrust.y_array From 67b14fe40e8da9bcc2d8ec6fbeb8868ac9331c44 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Fri, 14 Mar 2025 16:21:23 -0300 Subject: [PATCH 3/3] DEV: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d168763a..2e8635f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Attention: The newest changes should be on top --> ### Changed +- DOCS: reshape docs (closes #659) [#781](https://github.com/RocketPy-Team/RocketPy/pull/781) - MNT: EmptyMotor class inherits from Motor(ABC) [#779](https://github.com/RocketPy-Team/RocketPy/pull/779) ### Fixed