Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ Attention: The newest changes should be on top -->

- BUG: do not allow drawing rockets with no aerodynamic surface [#774](https://github.com/RocketPy-Team/RocketPy/pull/774)
- BUG: update flight simulation logic to include burn start time [#778](https://github.com/RocketPy-Team/RocketPy/pull/778)
- BUG: fixes get_instance_attributes for Flight objects containing a Rocket object without rail buttons [#786](https://github.com/RocketPy-Team/RocketPy/pull/786)
- BUG: fixed AGL altitude print for parachutes with lag [#788](https://github.com/RocketPy-Team/RocketPy/pull/788)


## [v1.8.0] - 2025-01-20

To install this version, run `pip install rocketpy==1.8.0`
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/mathutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -3492,7 +3492,7 @@ def funcify_method(*args, **kwargs): # pylint: disable=too-many-statements
>>> example.f
'Function from R1 to R1 : (x) → (f(x))'

In order to reset the cache, just delete de attribute from the instance:
In order to reset the cache, just delete the attribute from the instance:

>>> del example.f

Expand Down
2 changes: 1 addition & 1 deletion rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2954,7 +2954,7 @@ def __calculate_rail_button_forces(self): # TODO: complex method.
Rail Button 2 force in the 2 direction
"""
# First check for no rail phase or rail buttons
null_force = []
null_force = Function(0)
if self.out_of_rail_time_index == 0: # No rail phase, no rail button forces
warnings.warn(
"Trying to calculate rail button forces without a rail phase defined."
Expand Down
15 changes: 14 additions & 1 deletion tests/unit/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_flutter_plots(mock_show, flight_calisto_custom_wind): # pylint: disabl
), "An error occurred while running the utilities._flutter_plots function."


def test_get_instance_attributes(flight_calisto_robust):
def test_get_instance_attributes_with_robust_flight(flight_calisto_robust):
"""Tests if get_instance_attributes returns the expected results for a
robust flight object."""

Expand All @@ -178,6 +178,19 @@ def test_get_instance_attributes(flight_calisto_robust):
assert attr == value


def test_get_instance_attributes_with_flight_without_rail_buttons(flight_calisto):
"""Tests if get_instance_attributes returns the expected results for a
flight object that contains a rocket object without rail buttons."""

attributes = utilities.get_instance_attributes(flight_calisto)
for key, value in attributes.items():
attr = getattr(flight_calisto, key)
if isinstance(attr, np.ndarray):
assert np.allclose(attr, value)
else:
assert attr == value


@pytest.mark.parametrize(
"f, eps, expected",
[
Expand Down