Skip to content

Commit 9a8971d

Browse files
committed
MNT: Running ruff
1 parent 668ac35 commit 9a8971d

7 files changed

Lines changed: 27 additions & 65 deletions

File tree

rocketpy/motors/motor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
2-
import xml.etree.ElementTree as ET
32
import warnings
3+
import xml.etree.ElementTree as ET
44
from abc import ABC, abstractmethod
55
from functools import cached_property
66
from os import path

rocketpy/stochastic/stochastic_aero_surfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"""
55

66
from rocketpy.rocket.aero_surface import (
7+
AirBrakes,
78
EllipticalFins,
89
NoseCone,
910
RailButtons,
1011
Tail,
1112
TrapezoidalFins,
12-
AirBrakes,
1313
)
1414

1515
from .stochastic_model import StochasticModel

tests/integration/test_environment.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def test_set_elevation_open_elevation(
2828

2929

3030
@patch("matplotlib.pyplot.show")
31-
def test_era5_atmosphere(
32-
mock_show, example_spaceport_env
33-
): # pylint: disable=unused-argument
31+
def test_era5_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
3432
"""Tests the Reanalysis model with the ERA5 file. It uses an example file
3533
available in the data/weather folder of the RocketPy repository.
3634
@@ -51,9 +49,7 @@ def test_era5_atmosphere(
5149

5250

5351
@patch("matplotlib.pyplot.show")
54-
def test_custom_atmosphere(
55-
mock_show, example_plain_env
56-
): # pylint: disable=unused-argument
52+
def test_custom_atmosphere(mock_show, example_plain_env): # pylint: disable=unused-argument
5753
"""Tests the custom atmosphere model in the environment object.
5854
5955
Parameters
@@ -78,9 +74,7 @@ def test_custom_atmosphere(
7874

7975

8076
@patch("matplotlib.pyplot.show")
81-
def test_standard_atmosphere(
82-
mock_show, example_plain_env
83-
): # pylint: disable=unused-argument
77+
def test_standard_atmosphere(mock_show, example_plain_env): # pylint: disable=unused-argument
8478
"""Tests the standard atmosphere model in the environment object.
8579
8680
Parameters
@@ -132,9 +126,7 @@ def test_windy_atmosphere(example_euroc_env, model_name):
132126

133127
@pytest.mark.slow
134128
@patch("matplotlib.pyplot.show")
135-
def test_gfs_atmosphere(
136-
mock_show, example_spaceport_env
137-
): # pylint: disable=unused-argument
129+
def test_gfs_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
138130
"""Tests the Forecast model with the GFS file. It does not test the values,
139131
instead the test checks if the method runs without errors.
140132
@@ -151,9 +143,7 @@ def test_gfs_atmosphere(
151143

152144
@pytest.mark.slow
153145
@patch("matplotlib.pyplot.show")
154-
def test_nam_atmosphere(
155-
mock_show, example_spaceport_env
156-
): # pylint: disable=unused-argument
146+
def test_nam_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
157147
"""Tests the Forecast model with the NAM file.
158148
159149
Parameters
@@ -169,9 +159,7 @@ def test_nam_atmosphere(
169159

170160
@pytest.mark.slow
171161
@patch("matplotlib.pyplot.show")
172-
def test_rap_atmosphere(
173-
mock_show, example_spaceport_env
174-
): # pylint: disable=unused-argument
162+
def test_rap_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
175163
today = date.today()
176164
now = datetime.now(timezone.utc)
177165
example_spaceport_env.set_date((today.year, today.month, today.day, now.hour))
@@ -181,9 +169,7 @@ def test_rap_atmosphere(
181169

182170
@pytest.mark.slow
183171
@patch("matplotlib.pyplot.show")
184-
def test_gefs_atmosphere(
185-
mock_show, example_spaceport_env
186-
): # pylint: disable=unused-argument
172+
def test_gefs_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
187173
"""Tests the Ensemble model with the GEFS file.
188174
189175
Parameters
@@ -199,9 +185,7 @@ def test_gefs_atmosphere(
199185

200186
@pytest.mark.slow
201187
@patch("matplotlib.pyplot.show")
202-
def test_wyoming_sounding_atmosphere(
203-
mock_show, example_plain_env
204-
): # pylint: disable=unused-argument
188+
def test_wyoming_sounding_atmosphere(mock_show, example_plain_env): # pylint: disable=unused-argument
205189
"""Asserts whether the Wyoming sounding model in the environment
206190
object behaves as expected with respect to some attributes such
207191
as pressure, barometric_height, wind_velocity and temperature.
@@ -236,9 +220,7 @@ def test_wyoming_sounding_atmosphere(
236220

237221
@pytest.mark.slow
238222
@patch("matplotlib.pyplot.show")
239-
def test_hiresw_ensemble_atmosphere(
240-
mock_show, example_spaceport_env
241-
): # pylint: disable=unused-argument
223+
def test_hiresw_ensemble_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
242224
"""Tests the Forecast model with the HIRESW file.
243225
244226
Parameters
@@ -264,9 +246,7 @@ def test_hiresw_ensemble_atmosphere(
264246

265247
@pytest.mark.skip(reason="CMC model is currently not working")
266248
@patch("matplotlib.pyplot.show")
267-
def test_cmc_atmosphere(
268-
mock_show, example_spaceport_env
269-
): # pylint: disable=unused-argument
249+
def test_cmc_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
270250
"""Tests the Ensemble model with the CMC file.
271251
272252
Parameters

tests/integration/test_flight.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ def test_export_pressures(flight_calisto_robust):
195195

196196

197197
@patch("matplotlib.pyplot.show")
198-
def test_hybrid_motor_flight(
199-
mock_show, flight_calisto_hybrid_modded
200-
): # pylint: disable=unused-argument
198+
def test_hybrid_motor_flight(mock_show, flight_calisto_hybrid_modded): # pylint: disable=unused-argument
201199
"""Test the flight of a rocket with a hybrid motor. This test only validates
202200
that a flight simulation can be performed with a hybrid motor; it does not
203201
validate the results.
@@ -213,9 +211,7 @@ def test_hybrid_motor_flight(
213211

214212

215213
@patch("matplotlib.pyplot.show")
216-
def test_liquid_motor_flight(
217-
mock_show, flight_calisto_liquid_modded
218-
): # pylint: disable=unused-argument
214+
def test_liquid_motor_flight(mock_show, flight_calisto_liquid_modded): # pylint: disable=unused-argument
219215
"""Test the flight of a rocket with a liquid motor. This test only validates
220216
that a flight simulation can be performed with a liquid motor; it does not
221217
validate the results.
@@ -232,9 +228,7 @@ def test_liquid_motor_flight(
232228

233229
@pytest.mark.slow
234230
@patch("matplotlib.pyplot.show")
235-
def test_time_overshoot(
236-
mock_show, calisto_robust, example_spaceport_env
237-
): # pylint: disable=unused-argument
231+
def test_time_overshoot(mock_show, calisto_robust, example_spaceport_env): # pylint: disable=unused-argument
238232
"""Test the time_overshoot parameter of the Flight class. This basically
239233
calls the all_info() method for a simulation without time_overshoot and
240234
checks if it returns None. It is not testing if the values are correct,
@@ -263,9 +257,7 @@ def test_time_overshoot(
263257

264258

265259
@patch("matplotlib.pyplot.show")
266-
def test_simpler_parachute_triggers(
267-
mock_show, example_plain_env, calisto_robust
268-
): # pylint: disable=unused-argument
260+
def test_simpler_parachute_triggers(mock_show, example_plain_env, calisto_robust): # pylint: disable=unused-argument
269261
"""Tests different types of parachute triggers. This is important to ensure
270262
the code is working as intended, since the parachute triggers can have very
271263
different format definitions. It will add 3 parachutes using different
@@ -407,9 +399,7 @@ def test_eccentricity_on_flight( # pylint: disable=unused-argument
407399

408400

409401
@patch("matplotlib.pyplot.show")
410-
def test_air_brakes_flight(
411-
mock_show, flight_calisto_air_brakes
412-
): # pylint: disable=unused-argument
402+
def test_air_brakes_flight(mock_show, flight_calisto_air_brakes): # pylint: disable=unused-argument
413403
"""Test the flight of a rocket with air brakes. This test only validates
414404
that a flight simulation can be performed with air brakes; it does not
415405
validate the results.
@@ -429,9 +419,7 @@ def test_air_brakes_flight(
429419

430420

431421
@patch("matplotlib.pyplot.show")
432-
def test_initial_solution(
433-
mock_show, example_plain_env, calisto_robust
434-
): # pylint: disable=unused-argument
422+
def test_initial_solution(mock_show, example_plain_env, calisto_robust): # pylint: disable=unused-argument
435423
"""Tests the initial_solution option of the Flight class. This test simply
436424
simulates the flight using the initial_solution option and checks if the
437425
all_info method returns None.
@@ -476,9 +464,7 @@ def test_initial_solution(
476464

477465

478466
@patch("matplotlib.pyplot.show")
479-
def test_empty_motor_flight(
480-
mock_show, example_plain_env, calisto_motorless
481-
): # pylint: disable=unused-argument
467+
def test_empty_motor_flight(mock_show, example_plain_env, calisto_motorless): # pylint: disable=unused-argument
482468
flight = Flight(
483469
rocket=calisto_motorless,
484470
environment=example_plain_env,

tests/integration/test_flight_data_importer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def test_flight_importer_bella_lui():
2626
)
2727
assert fd.name == "Bella Lui, EPFL Rocket Team, 2020"
2828
assert "time" in fd._columns[path], "Can't find 'time' column in fd._columns"
29-
assert (
30-
"altitude" in fd._columns[path]
31-
), "Can't find 'altitude' column in fd._columns"
29+
assert "altitude" in fd._columns[path], (
30+
"Can't find 'altitude' column in fd._columns"
31+
)
3232
assert "vz" in fd._columns[path], "Can't find 'vz' column in fd._columns"
3333
assert np.isclose(fd.altitude(0), 0.201, atol=1e-4)
3434
assert np.isclose(fd.vz(0), 5.028, atol=1e-4)
@@ -51,7 +51,7 @@ def test_flight_importer_ndrt():
5151
)
5252
assert fd.name == "NDRT Rocket team, 2020"
5353
assert "time" in fd._columns[path], "Can't find 'time' column in fd._columns"
54-
assert (
55-
"altitude" in fd._columns[path]
56-
), "Can't find 'altitude' column in fd._columns"
54+
assert "altitude" in fd._columns[path], (
55+
"Can't find 'altitude' column in fd._columns"
56+
)
5757
assert np.isclose(fd.altitude(0), 0)

tests/integration/test_rocket.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def test_airfoil(
4545

4646

4747
@patch("matplotlib.pyplot.show")
48-
def test_air_brakes_clamp_on(
49-
mock_show, calisto_air_brakes_clamp_on
50-
): # pylint: disable=unused-argument
48+
def test_air_brakes_clamp_on(mock_show, calisto_air_brakes_clamp_on): # pylint: disable=unused-argument
5149
"""Test the air brakes class with clamp on configuration. This test checks
5250
the basic attributes and the deployment_level setter. It also checks the
5351
all_info method.

tests/integration/test_sensor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ def test_gnss_receiver(self):
8989

9090
@pytest.mark.parametrize("plane", ["xz", "yz"])
9191
@patch("matplotlib.pyplot.show")
92-
def test_draw(
93-
mock_show, calisto_with_sensors, plane
94-
): # pylint: disable=unused-argument
92+
def test_draw(mock_show, calisto_with_sensors, plane): # pylint: disable=unused-argument
9593
"""Test the drawing of the sensors."""
9694
calisto_with_sensors.draw(plane=plane)
9795

0 commit comments

Comments
 (0)