Skip to content

Commit 5fd8d4a

Browse files
Format code with black linter as required by project standards
Co-authored-by: Gui-FernandesBR <[email protected]>
1 parent 04c9a47 commit 5fd8d4a

15 files changed

+111
-52
lines changed

rocketpy/motors/solid_motor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def geometry_jacobian(t, y):
549549
inner_radius_derivative_wrt_height = 0
550550
height_derivative_wrt_inner_radius = 0
551551
height_derivative_wrt_height = 0
552-
# Height is constant when only radial burning is enabled,
552+
# Height is constant when only radial burning is enabled,
553553
# so all derivatives with respect to height are zero
554554

555555
return [

tests/integration/test_environment.py

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

2929

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

5052

5153
@patch("matplotlib.pyplot.show")
52-
def test_custom_atmosphere(mock_show, example_plain_env): # pylint: disable=unused-argument
54+
def test_custom_atmosphere(
55+
mock_show, example_plain_env
56+
): # pylint: disable=unused-argument
5357
"""Tests the custom atmosphere model in the environment object.
5458
5559
Parameters
@@ -74,7 +78,9 @@ def test_custom_atmosphere(mock_show, example_plain_env): # pylint: disable=unu
7478

7579

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

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

144152
@pytest.mark.slow
145153
@patch("matplotlib.pyplot.show")
146-
def test_nam_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
154+
def test_nam_atmosphere(
155+
mock_show, example_spaceport_env
156+
): # pylint: disable=unused-argument
147157
"""Tests the Forecast model with the NAM file.
148158
149159
Parameters
@@ -159,7 +169,9 @@ def test_nam_atmosphere(mock_show, example_spaceport_env): # pylint: disable=un
159169

160170
@pytest.mark.slow
161171
@patch("matplotlib.pyplot.show")
162-
def test_rap_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
172+
def test_rap_atmosphere(
173+
mock_show, example_spaceport_env
174+
): # pylint: disable=unused-argument
163175
today = date.today()
164176
now = datetime.now(timezone.utc)
165177
example_spaceport_env.set_date((today.year, today.month, today.day, now.hour))
@@ -169,7 +181,9 @@ def test_rap_atmosphere(mock_show, example_spaceport_env): # pylint: disable=un
169181

170182
@pytest.mark.slow
171183
@patch("matplotlib.pyplot.show")
172-
def test_gefs_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
184+
def test_gefs_atmosphere(
185+
mock_show, example_spaceport_env
186+
): # pylint: disable=unused-argument
173187
"""Tests the Ensemble model with the GEFS file.
174188
175189
Parameters
@@ -185,7 +199,9 @@ def test_gefs_atmosphere(mock_show, example_spaceport_env): # pylint: disable=u
185199

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

221237
@pytest.mark.slow
222238
@patch("matplotlib.pyplot.show")
223-
def test_hiresw_ensemble_atmosphere(mock_show, example_spaceport_env): # pylint: disable=unused-argument
239+
def test_hiresw_ensemble_atmosphere(
240+
mock_show, example_spaceport_env
241+
): # pylint: disable=unused-argument
224242
"""Tests the Forecast model with the HIRESW file.
225243
226244
Parameters
@@ -246,7 +264,9 @@ def test_hiresw_ensemble_atmosphere(mock_show, example_spaceport_env): # pylint
246264

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

tests/integration/test_environment_analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,7 @@ def test_exports(mock_show, env_analysis): # pylint: disable=unused-argument
6060

6161
@pytest.mark.slow
6262
@patch("matplotlib.pyplot.show")
63-
def test_create_environment_object(mock_show, env_analysis): # pylint: disable=unused-argument
63+
def test_create_environment_object(
64+
mock_show, env_analysis
65+
): # pylint: disable=unused-argument
6466
assert isinstance(env_analysis.create_environment_object(), Environment)

tests/integration/test_flight.py

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

196196

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

212214

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

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

258264

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

400408

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

420430

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

465477

466478
@patch("matplotlib.pyplot.show")
467-
def test_empty_motor_flight(mock_show, example_plain_env, calisto_motorless): # pylint: disable=unused-argument
479+
def test_empty_motor_flight(
480+
mock_show, example_plain_env, calisto_motorless
481+
): # pylint: disable=unused-argument
468482
flight = Flight(
469483
rocket=calisto_motorless,
470484
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 "altitude" in fd._columns[path], (
30-
"Can't find 'altitude' column in fd._columns"
31-
)
29+
assert (
30+
"altitude" in fd._columns[path]
31+
), "Can't find 'altitude' column in fd._columns"
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 "altitude" in fd._columns[path], (
55-
"Can't find 'altitude' column in fd._columns"
56-
)
54+
assert (
55+
"altitude" in fd._columns[path]
56+
), "Can't find 'altitude' column in fd._columns"
5757
assert np.isclose(fd.altitude(0), 0)

tests/integration/test_rocket.py

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

4646

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

tests/integration/test_sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def test_gnss_receiver(self):
9393

9494
@pytest.mark.parametrize("plane", ["xz", "yz"])
9595
@patch("matplotlib.pyplot.show")
96-
def test_draw(mock_show, calisto_with_sensors, plane): # pylint: disable=unused-argument
96+
def test_draw(
97+
mock_show, calisto_with_sensors, plane
98+
): # pylint: disable=unused-argument
9799
"""Test the drawing of the sensors."""
98100
calisto_with_sensors.draw(plane=plane)
99101

tests/integration/test_solidmotor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def test_solid_motor_info(mock_show, cesaroni_m1670):
1313
The SolidMotor object to be used in the tests.
1414
"""
1515
assert cesaroni_m1670.info() is None
16-
assert cesaroni_m1670.all_info() is None
16+
assert cesaroni_m1670.all_info() is None

tests/unit/test_aero_surfaces.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def test_powerseries_nosecones_setters(power, invalid_power, new_power):
7676

7777

7878
@patch("matplotlib.pyplot.show")
79-
def test_elliptical_fins_draw(mock_show, elliptical_fin_set): # pylint: disable=unused-argument
79+
def test_elliptical_fins_draw(
80+
mock_show, elliptical_fin_set
81+
): # pylint: disable=unused-argument
8082
assert elliptical_fin_set.plots.draw(filename=None) is None
8183

8284

@@ -85,7 +87,9 @@ def test_nose_cone_info(calisto_nose_cone):
8587

8688

8789
@patch("matplotlib.pyplot.show")
88-
def test_nose_cone_draw(mock_show, calisto_nose_cone): # pylint: disable=unused-argument
90+
def test_nose_cone_draw(
91+
mock_show, calisto_nose_cone
92+
): # pylint: disable=unused-argument
8993
assert calisto_nose_cone.draw(filename=None) is None
9094

9195

tests/unit/test_flight.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,9 @@ def test_rail_length(calisto_robust, example_plain_env, rail_length, out_of_rail
512512

513513

514514
@patch("matplotlib.pyplot.show")
515-
def test_lat_lon_conversion_robust(mock_show, example_spaceport_env, calisto_robust): # pylint: disable=unused-argument
515+
def test_lat_lon_conversion_robust(
516+
mock_show, example_spaceport_env, calisto_robust
517+
): # pylint: disable=unused-argument
516518
test_flight = Flight(
517519
rocket=calisto_robust,
518520
environment=example_spaceport_env,
@@ -529,7 +531,9 @@ def test_lat_lon_conversion_robust(mock_show, example_spaceport_env, calisto_rob
529531

530532

531533
@patch("matplotlib.pyplot.show")
532-
def test_lat_lon_conversion_from_origin(mock_show, example_plain_env, calisto_robust): # pylint: disable=unused-argument
534+
def test_lat_lon_conversion_from_origin(
535+
mock_show, example_plain_env, calisto_robust
536+
): # pylint: disable=unused-argument
533537
"additional tests to capture incorrect behaviors during lat/lon conversions"
534538

535539
test_flight = Flight(

0 commit comments

Comments
 (0)