Skip to content

Commit 9c0b3e7

Browse files
Merge pull request #648 from RocketPy-Team/rel/v1.4.2
REL: Bump versioning to RocketPy v1.4.2
2 parents cbd6a1d + 174aee5 commit 9c0b3e7

File tree

8 files changed

+52
-14
lines changed

8 files changed

+52
-14
lines changed

CHANGELOG.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,39 @@ Attention: The newest changes should be on top -->
3232

3333
### Added
3434

35-
-
3635

3736
### Changed
3837

39-
-
4038

4139
### Fixed
4240

43-
-
41+
42+
43+
## [v1.4.2] - 2024-08-03
44+
45+
You can install this version by running `pip install rocketpy==1.4.2`
46+
47+
### Changed
48+
49+
- REL: Bump versioning to RocketPy v1.4.2 [#648](https://github.com/RocketPy-Team/RocketPy/pull/648)
50+
- ENH: Adding rocket radius to RailButtons class [#643](https://github.com/RocketPy-Team/RocketPy/pull/643)
51+
52+
### Fixed
53+
54+
- BUG: Time Node Merge Not Including Controllers [#647](https://github.com/RocketPy-Team/RocketPy/pull/647)
4455

4556
## [v1.4.1] - 2024-07-20
4657

4758
You can install this version by running `pip install rocketpy==1.4.1`
4859

4960
### Changed
5061

51-
- Bumps rocketpy version to 1.4.1 [#646](https://github.com/RocketPy-Team/RocketPy/pull/646)
62+
- REL: Bumps rocketpy version to 1.4.1 [#646](https://github.com/RocketPy-Team/RocketPy/pull/646)
5263
- ENH: Insert apogee state into solution list during flight simulation [#638](https://github.com/RocketPy-Team/RocketPy/pull/638)
64+
- MNT: Refactor AeroSurfaces [#634](https://github.com/RocketPy-Team/RocketPy/pull/634)
5365
- ENH: Environment class major refactor may 2024 [#605](https://github.com/RocketPy-Team/RocketPy/pull/605)
5466
- MNT: Refactors the code to adopt flake8 [#631](https://github.com/RocketPy-Team/RocketPy/pull/631)
5567
- MNT: Refactors the code to adopt pylint [#621](https://github.com/RocketPy-Team/RocketPy/pull/621)
56-
- MNT: Refactor AeroSurfaces [#634](https://github.com/RocketPy-Team/RocketPy/pull/634)
5768

5869
## [1.4.0] - 2024-07-06
5970

docs/conf.py

Lines changed: 1 addition & 1 deletion
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.1"
28+
release = "1.4.2"
2929

3030

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

docs/user/installation.rst

Lines changed: 1 addition & 1 deletion
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.1
22+
pip install rocketpy==1.4.2
2323
2424
2525
Optional Installation Method: ``conda``

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rocketpy"
3-
version = "1.4.1"
3+
version = "1.4.2"
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

Lines changed: 12 additions & 2 deletions
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

Lines changed: 11 additions & 4 deletions
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

rocketpy/simulation/flight.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3498,6 +3498,7 @@ def merge(self):
34983498
try:
34993499
# Try to access the node and merge if it exists
35003500
tmp_dict[time].parachutes += node.parachutes
3501+
tmp_dict[time]._controllers += node._controllers
35013502
tmp_dict[time].callbacks += node.callbacks
35023503
except KeyError:
35033504
# If the node does not exist, add it to the dictionary

tests/unit/test_rocket.py

Lines changed: 9 additions & 0 deletions
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)