Skip to content

Commit

Permalink
Merge pull request #648 from RocketPy-Team/rel/v1.4.2
Browse files Browse the repository at this point in the history
REL: Bump versioning to RocketPy v1.4.2
  • Loading branch information
Gui-FernandesBR committed Aug 3, 2024
2 parents cbd6a1d + 174aee5 commit 9c0b3e7
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 14 deletions.
21 changes: 16 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,39 @@ Attention: The newest changes should be on top -->

### Added

-

### Changed

-

### Fixed

-


## [v1.4.2] - 2024-08-03

You can install this version by running `pip install rocketpy==1.4.2`

### Changed

- REL: Bump versioning to RocketPy v1.4.2 [#648](https://github.com/RocketPy-Team/RocketPy/pull/648)
- ENH: Adding rocket radius to RailButtons class [#643](https://github.com/RocketPy-Team/RocketPy/pull/643)

### Fixed

- BUG: Time Node Merge Not Including Controllers [#647](https://github.com/RocketPy-Team/RocketPy/pull/647)

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

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

### Changed

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

## [1.4.0] - 2024-07-06

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = "RocketPy Team"

# The full version, including alpha/beta/rc tags
release = "1.4.1"
release = "1.4.2"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.1
pip install rocketpy==1.4.2
Optional Installation Method: ``conda``
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rocketpy"
version = "1.4.1"
version = "1.4.2"
description="Advanced 6-DOF trajectory simulation for High-Power Rocketry."
dynamic = ["dependencies"]
readme = "README.md"
Expand Down
14 changes: 12 additions & 2 deletions rocketpy/rocket/aero_surface/rail_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ class RailButtons(AeroSurface):
relative to one of the other principal axis.
"""

def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
def __init__(
self,
buttons_distance,
angular_position=45,
name="Rail Buttons",
rocket_radius=None,
):
"""Initializes RailButtons Class.
Parameters
Expand All @@ -30,6 +36,10 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
relative to one of the other principal axis.
name : string, optional
Name of the rail buttons. Default is "Rail Buttons".
rocket_radius : int, float, optional
Radius of the rocket at the location of the rail buttons in meters.
If not provided, it will be calculated when the RailButtons object
is added to a Rocket object.
Returns
-------
Expand All @@ -40,7 +50,7 @@ def __init__(self, buttons_distance, angular_position=45, name="Rail Buttons"):
self.buttons_distance = buttons_distance
self.angular_position = angular_position
self.name = name

self.rocket_radius = rocket_radius
self.evaluate_lift_coefficient()
self.evaluate_center_of_pressure()

Expand Down
15 changes: 11 additions & 4 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ def add_surfaces(self, surfaces, positions):
the root chord which is highest in the rocket coordinate system.
For Tail type, position is relative to the point belonging to the
tail which is highest in the rocket coordinate system.
For RailButtons type, position is relative to the lower rail button.
See Also
--------
Expand All @@ -956,11 +957,16 @@ def add_surfaces(self, surfaces, positions):
-------
None
"""
try:
for surface, position in zip(surfaces, positions):
if not isinstance(surfaces, list):
surfaces = [surfaces]
positions = [positions]

for surface, position in zip(surfaces, positions):
if isinstance(surface, RailButtons):
surface.rocket_radius = surface.rocket_radius or self.radius
self.rail_buttons.add(surface, position)
else:
self.aerodynamic_surfaces.add(surface, position)
except TypeError:
self.aerodynamic_surfaces.add(surfaces, positions)

self.evaluate_center_of_pressure()
self.evaluate_stability_margin()
Expand Down Expand Up @@ -1512,6 +1518,7 @@ def set_rail_buttons(
rail_buttons = RailButtons(
buttons_distance=buttons_distance, angular_position=angular_position
)
rail_buttons.rocket_radius = rail_buttons.rocket_radius or self.radius
self.rail_buttons.add(rail_buttons, lower_button_position)
return rail_buttons

Expand Down
1 change: 1 addition & 0 deletions rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -3498,6 +3498,7 @@ def merge(self):
try:
# Try to access the node and merge if it exists
tmp_dict[time].parachutes += node.parachutes
tmp_dict[time]._controllers += node._controllers
tmp_dict[time].callbacks += node.callbacks
except KeyError:
# If the node does not exist, add it to the dictionary
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/test_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ def test_set_rail_button(calisto):
].position == pytest.approx(0.2, 1e-12)


def test_add_rail_button(calisto, calisto_rail_buttons):
calisto.add_surfaces(calisto_rail_buttons, -0.5)
assert calisto.rail_buttons[0].position == -0.5
upper_position = (
calisto_rail_buttons.buttons_distance + calisto.rail_buttons[0].position
)
assert upper_position == pytest.approx(0.2, 1e-12)


def test_evaluate_total_mass(calisto_motorless):
"""Tests the evaluate_total_mass method of the Rocket class.
Both with respect to return instances and expected behaviour.
Expand Down

0 comments on commit 9c0b3e7

Please sign in to comment.