Skip to content

Commit d3a9004

Browse files
committed
Merge remote-tracking branch 'origin/develop' into enh/parallel_montecarlo
2 parents 25a2fed + a901b45 commit d3a9004

File tree

7 files changed

+52
-16
lines changed

7 files changed

+52
-16
lines changed

CHANGELOG.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,26 @@ Attention: The newest changes should be on top -->
3535
-
3636

3737
### Changed
38-
39-
- ENH: Insert apogee state into solution list during flight simulation [#638](https://github.com/RocketPy-Team/RocketPy/pull/638)
40-
- ENH: Environment class major refactor may 2024 [#605](https://github.com/RocketPy-Team/RocketPy/pull/605)
41-
- MNT: Refactors the code to adopt pylint [#621](https://github.com/RocketPy-Team/RocketPy/pull/621)
42-
- MNT: Refactor AeroSurfaces [#634](https://github.com/RocketPy-Team/RocketPy/pull/634)
38+
39+
- ENH: Adding rocket radius to RailButtons class [#643](https://github.com/RocketPy-Team/RocketPy/pull/643)
4340

4441
### Fixed
4542

4643
-
4744

45+
## [v1.4.1] - 2024-07-20
46+
47+
You can install this version by running `pip install rocketpy==1.4.1`
48+
49+
### Changed
50+
51+
- Bumps rocketpy version to 1.4.1 [#646](https://github.com/RocketPy-Team/RocketPy/pull/646)
52+
- ENH: Insert apogee state into solution list during flight simulation [#638](https://github.com/RocketPy-Team/RocketPy/pull/638)
53+
- MNT: Refactor AeroSurfaces [#634](https://github.com/RocketPy-Team/RocketPy/pull/634)
54+
- ENH: Environment class major refactor may 2024 [#605](https://github.com/RocketPy-Team/RocketPy/pull/605)
55+
- MNT: Refactors the code to adopt flake8 [#631](https://github.com/RocketPy-Team/RocketPy/pull/631)
56+
- MNT: Refactors the code to adopt pylint [#621](https://github.com/RocketPy-Team/RocketPy/pull/621)
57+
4858
## [1.4.0] - 2024-07-06
4959

5060
You can install this version by running `pip install rocketpy==1.4.0`
@@ -93,12 +103,12 @@ You can install this version by running `pip install rocketpy==1.3.0`
93103
- MNT: refactor u_dot parachute method [#596](https://github.com/RocketPy-Team/RocketPy/pull/596)
94104
- BLD: Change setup.py to pyproject.toml [#589](https://github.com/RocketPy-Team/RocketPy/pull/589)
95105
- DEP: delete deprecated rocketpy.tools.cached_property [#587](https://github.com/RocketPy-Team/RocketPy/pull/587)
96-
- ENH: Flight simulation speed up [#581] (https://github.com/RocketPy-Team/RocketPy/pull/581)
106+
- ENH: Flight simulation speed up [#581](https://github.com/RocketPy-Team/RocketPy/pull/581)
97107
- MNT: Modularize Rocket Draw [#580](https://github.com/RocketPy-Team/RocketPy/pull/580)
98108
- DOC: Improvements of Environment docstring phrasing [#565](https://github.com/RocketPy-Team/RocketPy/pull/565)
99109
- MNT: Refactor flight prints module [#579](https://github.com/RocketPy-Team/RocketPy/pull/579)
100110
- DOC: Convert CompareFlights example notebooks to .rst files [#576](https://github.com/RocketPy-Team/RocketPy/pull/576)
101-
- MNT: Refactor inertia calculations using parallel axis theorem [#573] (https://github.com/RocketPy-Team/RocketPy/pull/573)
111+
- MNT: Refactor inertia calculations using parallel axis theorem [#573](https://github.com/RocketPy-Team/RocketPy/pull/573)
102112
- ENH: Optional argument to show the plot in Function.compare_plots [#563](https://github.com/RocketPy-Team/RocketPy/pull/563)
103113

104114
### Fixed

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
author = "RocketPy Team"
2626

2727
# The full version, including alpha/beta/rc tags
28-
release = "1.4.0"
28+
release = "1.4.1"
2929

3030

3131
# -- General configuration ---------------------------------------------------

docs/user/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins
1919

2020
.. code-block:: shell
2121
22-
pip install rocketpy==1.4.0
22+
pip install rocketpy==1.4.1
2323
2424
2525
Optional Installation Method: ``conda``

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rocketpy"
3-
version = "1.4.0"
3+
version = "1.4.1"
44
description="Advanced 6-DOF trajectory simulation for High-Power Rocketry."
55
dynamic = ["dependencies"]
66
readme = "README.md"

rocketpy/rocket/aero_surface/rail_buttons.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ class RailButtons(AeroSurface):
1717
relative to one of the other principal axis.
1818
"""
1919

20-
def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
20+
def __init__(
21+
self,
22+
buttons_distance,
23+
angular_position=45,
24+
name="Rail Buttons",
25+
rocket_radius=None,
26+
):
2127
"""Initializes RailButtons Class.
2228
2329
Parameters
@@ -30,6 +36,10 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
3036
relative to one of the other principal axis.
3137
name : string, optional
3238
Name of the rail buttons. Default is "Rail Buttons".
39+
rocket_radius : int, float, optional
40+
Radius of the rocket at the location of the rail buttons in meters.
41+
If not provided, it will be calculated when the RailButtons object
42+
is added to a Rocket object.
3343
3444
Returns
3545
-------
@@ -40,7 +50,7 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
4050
self.buttons_distance = buttons_distance
4151
self.angular_position = angular_position
4252
self.name = name
43-
53+
self.rocket_radius = rocket_radius
4454
self.evaluate_lift_coefficient()
4555
self.evaluate_center_of_pressure()
4656

rocketpy/rocket/rocket.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ def add_surfaces(self, surfaces, positions):
947947
the root chord which is highest in the rocket coordinate system.
948948
For Tail type, position is relative to the point belonging to the
949949
tail which is highest in the rocket coordinate system.
950+
For RailButtons type, position is relative to the lower rail button.
950951
951952
See Also
952953
--------
@@ -956,11 +957,16 @@ def add_surfaces(self, surfaces, positions):
956957
-------
957958
None
958959
"""
959-
try:
960-
for surface, position in zip(surfaces, positions):
960+
if not isinstance(surfaces, list):
961+
surfaces = [surfaces]
962+
positions = [positions]
963+
964+
for surface, position in zip(surfaces, positions):
965+
if isinstance(surface, RailButtons):
966+
surface.rocket_radius = surface.rocket_radius or self.radius
967+
self.rail_buttons.add(surface, position)
968+
else:
961969
self.aerodynamic_surfaces.add(surface, position)
962-
except TypeError:
963-
self.aerodynamic_surfaces.add(surfaces, positions)
964970

965971
self.evaluate_center_of_pressure()
966972
self.evaluate_stability_margin()
@@ -1512,6 +1518,7 @@ def set_rail_buttons(
15121518
rail_buttons = RailButtons(
15131519
buttons_distance=buttons_distance, angular_position=angular_position
15141520
)
1521+
rail_buttons.rocket_radius = rail_buttons.rocket_radius or self.radius
15151522
self.rail_buttons.add(rail_buttons, lower_button_position)
15161523
return rail_buttons
15171524

tests/unit/test_rocket.py

+9
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,15 @@ def test_set_rail_button(calisto):
392392
].position == pytest.approx(0.2, 1e-12)
393393

394394

395+
def test_add_rail_button(calisto, calisto_rail_buttons):
396+
calisto.add_surfaces(calisto_rail_buttons, -0.5)
397+
assert calisto.rail_buttons[0].position == -0.5
398+
upper_position = (
399+
calisto_rail_buttons.buttons_distance + calisto.rail_buttons[0].position
400+
)
401+
assert upper_position == pytest.approx(0.2, 1e-12)
402+
403+
395404
def test_evaluate_total_mass(calisto_motorless):
396405
"""Tests the evaluate_total_mass method of the Rocket class.
397406
Both with respect to return instances and expected behaviour.

0 commit comments

Comments
 (0)