Skip to content

Commit 1ec0f48

Browse files
format flight.py with ruff to comply with project style
1 parent 5cceafe commit 1ec0f48

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

rocketpy/simulation/flight.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,8 @@ def __simulate(self, verbose):
10091009
i += 1
10101010
# Create flight phase for time after inflation
10111011
callbacks = [
1012-
lambda self, parachute_cd_s=parachute.cd_s: setattr(
1012+
lambda self,
1013+
parachute_cd_s=parachute.cd_s: setattr(
10131014
self, "parachute_cd_s", parachute_cd_s
10141015
)
10151016
]
@@ -1401,9 +1402,7 @@ def udot_rail2(self, t, u, post_processing=False): # pragma: no cover
14011402
# Hey! We will finish this function later, now we just can use u_dot
14021403
return self.u_dot_generalized(t, u, post_processing=post_processing)
14031404

1404-
def u_dot(
1405-
self, t, u, post_processing=False
1406-
): # pylint: disable=too-many-locals,too-many-statements
1405+
def u_dot(self, t, u, post_processing=False): # pylint: disable=too-many-locals,too-many-statements
14071406
"""Calculates derivative of u state vector with respect to time
14081407
when rocket is flying in 6 DOF motion during ascent out of rail
14091408
and descent without parachute.
@@ -1723,9 +1722,7 @@ def u_dot(
17231722

17241723
return u_dot
17251724

1726-
def u_dot_generalized(
1727-
self, t, u, post_processing=False
1728-
): # pylint: disable=too-many-locals,too-many-statements
1725+
def u_dot_generalized(self, t, u, post_processing=False): # pylint: disable=too-many-locals,too-many-statements
17291726
"""Calculates derivative of u state vector with respect to time when the
17301727
rocket is flying in 6 DOF motion in space and significant mass variation
17311728
effects exist. Typical flight phases include powered ascent after launch
@@ -3534,7 +3531,9 @@ def add(self, flight_phase, index=None): # TODO: quite complex method
35343531
new_index = (
35353532
index - 1
35363533
if flight_phase.t < previous_phase.t
3537-
else index + 1 if flight_phase.t > next_phase.t else index
3534+
else index + 1
3535+
if flight_phase.t > next_phase.t
3536+
else index
35383537
)
35393538
flight_phase.t += adjust
35403539
self.add(flight_phase, new_index)

tests/unit/test_flight_export_deprecation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest.mock import patch
22
import pytest
33

4+
45
def test_export_data_deprecated_emits_warning_and_delegates(flight_calisto, tmp_path):
56
"""Expect: calling Flight.export_data emits DeprecationWarning and delegates to FlightDataExporter.export_data."""
67
out = tmp_path / "out.csv"

0 commit comments

Comments
 (0)