From e95fe044ed3d340bbf041bf2ed34dbe2f97044f3 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Wed, 29 Nov 2023 21:52:34 -0300 Subject: [PATCH 01/11] DOC: Change from % to ! in the first cell to run properly in Colab. --- docs/notebooks/getting_started_colab.ipynb | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/docs/notebooks/getting_started_colab.ipynb b/docs/notebooks/getting_started_colab.ipynb index 2ba6d3bd9..4ba05dd70 100644 --- a/docs/notebooks/getting_started_colab.ipynb +++ b/docs/notebooks/getting_started_colab.ipynb @@ -22,10 +22,9 @@ "We start by setting up our environment. To run this notebook, we will need:\n", "\n", "- RocketPy\n", - "- netCDF4 (to get weather forecasts)\n", "- Data files (we will clone RocketPy's repository for these)\n", "\n", - "Therefore, let's run the following lines of code:\n" + "Therefore, let's run the following lines of code:" ] }, { @@ -38,8 +37,8 @@ }, "outputs": [], "source": [ - "%pip install rocketpy netCDF4\n", - "%git clone https://github.com/giovaniceotto/RocketPy.git" + "!pip install rocketpy\n", + "!git clone https://github.com/giovaniceotto/RocketPy.git" ] }, { @@ -70,16 +69,6 @@ "Here we go through a simplified rocket trajectory simulation to get you started. Let's start by importing the rocketpy module.\n" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%load_ext autoreload\n", - "%autoreload 2" - ] - }, { "cell_type": "code", "execution_count": 1, @@ -101,7 +90,7 @@ "id": "ImgkhEkZNVE8" }, "source": [ - "If you are using Jupyter Notebooks, it is recommended to run the following line to make matplotlib plots which will be shown later interactive and higher quality.\n" + "It is recommended to run the following line to make matplotlib plots which will be shown later interactive and higher quality.\n" ] }, { From ecf536d2061ba796a04e53abc73979052c8fe889 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Wed, 29 Nov 2023 22:46:29 -0300 Subject: [PATCH 02/11] MNT: changes Generic Motor exhaust velocity to cached property --- rocketpy/motors/motor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index 1af08d7f1..b2e658881 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -1214,7 +1214,7 @@ def propellant_initial_mass(self): """ return self.propellant_initial_mass - @funcify_method("Time (s)", "Exhaust velocity (m/s)") + @cached_property def exhaust_velocity(self): """Exhaust velocity by assuming it as a constant. The formula used is total impulse/propellant initial mass. From f35fbb540f79d2678eb550a50dc265e0d17dad67 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Wed, 29 Nov 2023 22:59:29 -0300 Subject: [PATCH 03/11] REL: Update changelog to include generic motor fix --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed80182ab..cb2a29344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,14 +42,14 @@ straightforward as possible. - -## [v1.1.3] - 2023-11-29 +## [v1.1.3] - 2023-11-30 -Here we write upgrading notes for brands. It's a team effort to make them as -straightforward as possible. +You can install this version by running `pip install rocketpy==1.1.3` ### Fixed -- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492/files) +- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492) +- FIX: Never ending Flight simulations when using a GenericMotor [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) ## [v1.1.2] - 2023-11-25 From 0f1cb2977f87b6cfeaf5c821a03401a0f88a0850 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Wed, 29 Nov 2023 23:29:52 -0300 Subject: [PATCH 04/11] Revert "MNT: changes Generic Motor exhaust velocity to cached property" This reverts commit ecf536d2061ba796a04e53abc73979052c8fe889. --- rocketpy/motors/motor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index b2e658881..1af08d7f1 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -1214,7 +1214,7 @@ def propellant_initial_mass(self): """ return self.propellant_initial_mass - @cached_property + @funcify_method("Time (s)", "Exhaust velocity (m/s)") def exhaust_velocity(self): """Exhaust velocity by assuming it as a constant. The formula used is total impulse/propellant initial mass. From 9b169d16597137749fec661d3cbae3ff5275ee58 Mon Sep 17 00:00:00 2001 From: giovaniceotto Date: Wed, 29 Nov 2023 23:31:40 -0300 Subject: [PATCH 05/11] FIX: employ set discrete on (total_)mass_flow_rate in Motor and GenericMotor to avoid lambdas --- rocketpy/motors/motor.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index 1af08d7f1..6f2c51aa8 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -450,7 +450,11 @@ def total_mass_flow_rate(self): rate should not be greater than `total_mass_flow_rate`, otherwise the grains mass flow rate will be negative, losing physical meaning. """ - return -1 * self.thrust / self.exhaust_velocity + return ( + -1 + * self.thrust + / self.exhaust_velocity.set_discrete_based_on_model(self.thrust) + ) @property @abstractmethod @@ -1232,7 +1236,11 @@ def mass_flow_rate(self): velocity. The formula used is the opposite of thrust divided by exhaust velocity. """ - return -1 * self.thrust / self.exhaust_velocity + return ( + -1 + * self.thrust + / self.exhaust_velocity.set_discrete_based_on_model(self.thrust) + ) @funcify_method("Time (s)", "center of mass (m)") def center_of_propellant_mass(self): From e4e83ae012c1f2b4782bdeb25bf80862d822fb91 Mon Sep 17 00:00:00 2001 From: Pedro Bressan Date: Thu, 30 Nov 2023 12:32:56 -0300 Subject: [PATCH 06/11] MNT: change exhaust velocity to discretize on definition. --- rocketpy/motors/hybrid_motor.py | 6 ++++-- rocketpy/motors/motor.py | 16 +++++----------- rocketpy/motors/solid_motor.py | 4 +++- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index 92f386177..45fc2b819 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -1,4 +1,4 @@ -from ..mathutils.function import funcify_method, reset_funcified_methods +from ..mathutils.function import Function, funcify_method, reset_funcified_methods from ..plots.hybrid_motor_plots import _HybridMotorPlots from ..prints.hybrid_motor_prints import _HybridMotorPrints from .liquid_motor import LiquidMotor @@ -372,7 +372,9 @@ def exhaust_velocity(self): self.exhaust_velocity : Function Gas exhaust velocity of the motor. """ - return self.total_impulse / self.propellant_initial_mass + return Function( + self.total_impulse / self.propellant_initial_mass + ).set_discrete_based_on_model(self.thrust) @funcify_method("Time (s)", "Mass (kg)") def propellant_mass(self): diff --git a/rocketpy/motors/motor.py b/rocketpy/motors/motor.py index 6f2c51aa8..0ed7277d0 100644 --- a/rocketpy/motors/motor.py +++ b/rocketpy/motors/motor.py @@ -450,11 +450,7 @@ def total_mass_flow_rate(self): rate should not be greater than `total_mass_flow_rate`, otherwise the grains mass flow rate will be negative, losing physical meaning. """ - return ( - -1 - * self.thrust - / self.exhaust_velocity.set_discrete_based_on_model(self.thrust) - ) + return -1 * self.thrust / self.exhaust_velocity @property @abstractmethod @@ -1228,7 +1224,9 @@ def exhaust_velocity(self): self.exhaust_velocity : Function Gas exhaust velocity of the motor. """ - return self.total_impulse / self.propellant_initial_mass + return Function( + self.total_impulse / self.propellant_initial_mass + ).set_discrete_based_on_model(self.thrust) @funcify_method("Time (s)", "Mass Flow Rate (kg/s)") def mass_flow_rate(self): @@ -1236,11 +1234,7 @@ def mass_flow_rate(self): velocity. The formula used is the opposite of thrust divided by exhaust velocity. """ - return ( - -1 - * self.thrust - / self.exhaust_velocity.set_discrete_based_on_model(self.thrust) - ) + return -1 * self.thrust / self.exhaust_velocity @funcify_method("Time (s)", "center of mass (m)") def center_of_propellant_mass(self): diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index fc7109392..8572167ca 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -381,7 +381,9 @@ def exhaust_velocity(self): self.exhaust_velocity : Function Gas exhaust velocity of the motor. """ - return self.total_impulse / self.propellant_initial_mass + return Function( + self.total_impulse / self.propellant_initial_mass + ).set_discrete_based_on_model(self.thrust) @property def propellant_initial_mass(self): From fa7e42f9808b176e3c92b0cf08eb7b0206326378 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Wed, 6 Dec 2023 21:21:46 +0100 Subject: [PATCH 07/11] DOC: cahnge % to ! in remaining notebooks --- docs/notebooks/deployable_payload_example.ipynb | 4 ++-- docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb | 5 ++--- .../dispersion_analysis/parachute_drop_from_helicopter.ipynb | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/notebooks/deployable_payload_example.ipynb b/docs/notebooks/deployable_payload_example.ipynb index b753f9bca..fb96eb06d 100644 --- a/docs/notebooks/deployable_payload_example.ipynb +++ b/docs/notebooks/deployable_payload_example.ipynb @@ -44,8 +44,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install rocketpy netCDF4\n", - "%git clone https://github.com/RocketPy-Team/RocketPy.git" + "!pip install rocketpy netCDF4\n", + "!git clone https://github.com/RocketPy-Team/RocketPy.git" ] }, { diff --git a/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb b/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb index 3ecdf1ad7..a15dc210f 100644 --- a/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb +++ b/docs/notebooks/dispersion_analysis/dispersion_analysis.ipynb @@ -37,7 +37,7 @@ "metadata": {}, "outputs": [], "source": [ - "%git clone https://github.com/RocketPy-Team/RocketPy.git\n", + "!git clone https://github.com/RocketPy-Team/RocketPy.git\n", "import os\n", "\n", "os.chdir(\"RocketPy/docs/notebooks/dispersion_analysis\")" @@ -66,8 +66,7 @@ }, "outputs": [], "source": [ - "%pip install netCDF4\n", - "%pip install rocketpy" + "!pip install rocketpy" ] }, { diff --git a/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb b/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb index 91b48a0f8..e9709ff14 100644 --- a/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb +++ b/docs/notebooks/dispersion_analysis/parachute_drop_from_helicopter.ipynb @@ -31,7 +31,7 @@ "metadata": {}, "outputs": [], "source": [ - "%git clone https://github.com/giovaniceotto/RocketPy.git\n", + "!git clone https://github.com/giovaniceotto/RocketPy.git\n", "import os\n", "\n", "os.chdir(\"RocketPy/docs/notebooks/dispersion_analysis\")" @@ -60,8 +60,7 @@ }, "outputs": [], "source": [ - "%pip install netCDF4\n", - "%pip install rocketpy" + "!pip install rocketpy" ] }, { From e336f2c3aeeb2a111bf6d3f4f7327563f94e51e1 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Thu, 7 Dec 2023 01:11:01 +0100 Subject: [PATCH 08/11] REL: bump version to v1.1.4 --- 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 820d3f347..8881e55db 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.3" +release = "1.1.4" # -- General configuration --------------------------------------------------- diff --git a/docs/user/installation.rst b/docs/user/installation.rst index ab6b0c9d9..6884720d4 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.3 + pip install rocketpy==1.1.4 Optional Installation Method: ``conda`` diff --git a/setup.py b/setup.py index b2e475b26..a2a219faa 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setuptools.setup( name="rocketpy", - version="1.1.3", + version="1.1.4", install_requires=necessary_require, extras_require={ "env_analysis": env_analysis_require, From 00c6336317f8e3dc3f48620e906b659b67f193a7 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Thu, 7 Dec 2023 01:16:20 +0100 Subject: [PATCH 09/11] MNT: update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2a29344..dc5457371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,15 @@ straightforward as possible. - +## [v1.1.4] - 2023-12-07 + +You can install this version by running `pip install rocketpy==1.1.4` + +### Fixed + +- DOC: Change from % to ! in the first cell to run properly in Colab. [#496](https://github.com/RocketPy-Team/RocketPy/pull/496) +- FIX: changes Generic Motor exhaust velocity to cached property [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) + ## [v1.1.3] - 2023-11-30 You can install this version by running `pip install rocketpy==1.1.3` From 7d553c29afd5baddff5fb47ebb31863d0e6c86b5 Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Wed, 6 Dec 2023 21:59:35 -0300 Subject: [PATCH 10/11] DOC: Refactor CHANGELOG.md to adhere to project guidelines --- CHANGELOG.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc5457371..b72d73f2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,15 +14,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `Security` in case of vulnerabilities. Should not be here: - - tests - - github maintenance - - merge commits + - Tests and test updates. + - GitHub maintenance tasks (repository reorganization or CI changes, etc.) + - Merge commits, as they usually don't contain information valuable to the end-user. + - Small refactors that don't impact the functionality or improve performance. + - Minor changes such as "updated a notebook", "updated readme", or other + documentation tweaks unless they significantly enhance understanding or usability. + - In summary: if your change doesn't impact other codes or doesn't offer a + significant improvement for the final user, it probably shouldn't be here. Types of messages: - - Usually the message is the PR title and number - - If the PR is too long to accomplish all the changes (it shouldn't be...), - you can use a second line to describe it - + - The primary message is usually the title of the PR and its number. + - If the PR encompasses a wide range of changes (which ideally it shouldn't), + you can use a second line or a brief list to describe these changes succinctly. + - Ensure the description is clear and understandable even for those who + might not have deep technical knowledge of the project. --> ## [Unreleased] - yyyy-mm-dd @@ -48,19 +54,17 @@ You can install this version by running `pip install rocketpy==1.1.4` ### Fixed -- DOC: Change from % to ! in the first cell to run properly in Colab. [#496](https://github.com/RocketPy-Team/RocketPy/pull/496) - FIX: changes Generic Motor exhaust velocity to cached property [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) -## [v1.1.3] - 2023-11-30 +## [v1.1.3] - 2023-11-29 You can install this version by running `pip install rocketpy==1.1.3` ### Fixed -- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492) -- FIX: Never ending Flight simulations when using a GenericMotor [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) +- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492) -## [v1.1.2] - 2023-11-25 +## [v1.1.2] - 2023-11-27 You can install this version by running `pip install rocketpy==1.1.2` @@ -68,7 +72,7 @@ You can install this version by running `pip install rocketpy==1.1.2` - BUG: Function breaks if a header is present in the csv file [#485](https://github.com/RocketPy-Team/RocketPy/pull/485) -## [v1.1.1] - 2023-11-23 +## [v1.1.1] - 2023-11-24 You can install this version by running `pip install rocketpy==1.1.1` From 0c49c0bb5b1d1ed83e545f4c0920b75a4f06400c Mon Sep 17 00:00:00 2001 From: Gui-FernandesBR Date: Thu, 7 Dec 2023 01:05:20 -0300 Subject: [PATCH 11/11] REV: Revert changes on CHANGELOG.md This reverts commit 7d553c29afd5baddff5fb47ebb31863d0e6c86b5. --- CHANGELOG.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b72d73f2e..dc5457371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,21 +14,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `Security` in case of vulnerabilities. Should not be here: - - Tests and test updates. - - GitHub maintenance tasks (repository reorganization or CI changes, etc.) - - Merge commits, as they usually don't contain information valuable to the end-user. - - Small refactors that don't impact the functionality or improve performance. - - Minor changes such as "updated a notebook", "updated readme", or other - documentation tweaks unless they significantly enhance understanding or usability. - - In summary: if your change doesn't impact other codes or doesn't offer a - significant improvement for the final user, it probably shouldn't be here. + - tests + - github maintenance + - merge commits Types of messages: - - The primary message is usually the title of the PR and its number. - - If the PR encompasses a wide range of changes (which ideally it shouldn't), - you can use a second line or a brief list to describe these changes succinctly. - - Ensure the description is clear and understandable even for those who - might not have deep technical knowledge of the project. + - Usually the message is the PR title and number + - If the PR is too long to accomplish all the changes (it shouldn't be...), + you can use a second line to describe it + --> ## [Unreleased] - yyyy-mm-dd @@ -54,17 +48,19 @@ You can install this version by running `pip install rocketpy==1.1.4` ### Fixed +- DOC: Change from % to ! in the first cell to run properly in Colab. [#496](https://github.com/RocketPy-Team/RocketPy/pull/496) - FIX: changes Generic Motor exhaust velocity to cached property [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) -## [v1.1.3] - 2023-11-29 +## [v1.1.3] - 2023-11-30 You can install this version by running `pip install rocketpy==1.1.3` ### Fixed -- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492) +- FIX: Broken Function.get_value_opt for N-Dimensional Functions [#492](https://github.com/RocketPy-Team/RocketPy/pull/492) +- FIX: Never ending Flight simulations when using a GenericMotor [#497](https://github.com/RocketPy-Team/RocketPy/pull/497) -## [v1.1.2] - 2023-11-27 +## [v1.1.2] - 2023-11-25 You can install this version by running `pip install rocketpy==1.1.2` @@ -72,7 +68,7 @@ You can install this version by running `pip install rocketpy==1.1.2` - BUG: Function breaks if a header is present in the csv file [#485](https://github.com/RocketPy-Team/RocketPy/pull/485) -## [v1.1.1] - 2023-11-24 +## [v1.1.1] - 2023-11-23 You can install this version by running `pip install rocketpy==1.1.1`