Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix get_controller_observed_variables in the air brakes examples #551

Merged
merged 3 commits into from
Feb 9, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ You can install this version by running `pip install rocketpy==1.2.0`

### Fixed

- BUG: fix `get_controller_observed_variables` in the air brakes examples [#551](https://github.com/RocketPy-Team/RocketPy/pull/551)
- MNT: small fixes before v1.2 [#550](https://github.com/RocketPy-Team/RocketPy/pull/550)
- BUG: Elliptical Fins Draw [#548](https://github.com/RocketPy-Team/RocketPy/pull/548)
- BUG: 3D trajectory plot not labeling axes [#533](https://github.com/RocketPy-Team/RocketPy/pull/533)
Expand Down
31 changes: 15 additions & 16 deletions docs/notebooks/air_brakes_example.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/user/airbrakes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ Then we can plot the data we want.

time_list, deployment_level_list, drag_coefficient_list = [], [], []

for time, deployment_level, drag_coefficient in test_flight.get_controller_observed_variables:
obs_vars = test_flight.get_controller_observed_variables()

for time, deployment_level, drag_coefficient in obs_vars:
time_list.append(time)
deployment_level_list.append(deployment_level)
drag_coefficient_list.append(drag_coefficient)
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/test_flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,11 @@ def test_export_kml(flight_calisto_robust):
assert np.allclose(test_flight.latitude[:, 1], lat, atol=1e-3) == True
assert np.allclose(test_flight.longitude[:, 1], lon, atol=1e-3) == True
assert np.allclose(test_flight.z[:, 1], z, atol=1e-3) == True


def test_get_controller_observed_variables(flight_calisto_air_brakes):
"""Tests whether the method Flight.get_controller_observed_variables is
working as intended."""
obs_vars = flight_calisto_air_brakes.get_controller_observed_variables()
assert isinstance(obs_vars, list)
assert len(obs_vars) == 0