Skip to content

Commit b4885ae

Browse files
committed
STY: solve linting and style remarks.
1 parent 5284fb5 commit b4885ae

File tree

7 files changed

+12
-24
lines changed

7 files changed

+12
-24
lines changed

rocketpy/control/controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from inspect import signature
22
from typing import Iterable
3+
34
from rocketpy.tools import from_hex_decode, to_hex_encode
45

56
from ..prints.controller_prints import _ControllerPrints

rocketpy/rocket/aero_surface/air_brakes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def all_info(self):
207207
self.info()
208208
self.plots.drag_coefficient_curve()
209209

210+
# pylint: disable=unused-argument
210211
def to_dict(self, **kwargs):
211212
return {
212213
"drag_coefficient_curve": self.drag_coefficient,

rocketpy/rocket/rocket.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import math
2+
import warnings
3+
from typing import Iterable
24

35
import numpy as np
4-
from rocketpy.tools import find_obj_from_hash
5-
from typing import Iterable
66

77
from rocketpy.control.controller import _Controller
88
from rocketpy.mathutils.function import Function
@@ -23,7 +23,11 @@
2323
from rocketpy.rocket.aero_surface.generic_surface import GenericSurface
2424
from rocketpy.rocket.components import Components
2525
from rocketpy.rocket.parachute import Parachute
26-
from rocketpy.tools import deprecated, parallel_axis_theorem_from_com
26+
from rocketpy.tools import (
27+
deprecated,
28+
find_obj_from_hash,
29+
parallel_axis_theorem_from_com,
30+
)
2731

2832

2933
# pylint: disable=too-many-instance-attributes, too-many-public-methods, too-many-instance-attributes

rocketpy/sensors/sensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def _generic_export_measured_data(self, filename, file_format, data_labels):
271271
print(f"Data saved to {filename}")
272272
return
273273

274+
# pylint: disable=unused-argument
274275
def to_dict(self, **kwargs):
275276
return {
276277
"sampling_rate": self.sampling_rate,

rocketpy/tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from cftime import num2pydate
2525
from matplotlib.patches import Ellipse
2626
from packaging import version as packaging_version
27-
from typing import Iterable
2827

2928
# Mapping of module name and the name of the package that should be installed
3029
INSTALL_MAPPING = {"IPython": "ipython"}

tests/integration/test_encoding.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import json
22
import os
3+
from unittest.mock import patch
34

45
import numpy as np
56
import pytest
6-
from unittest.mock import patch
7-
87

98
from rocketpy._encoders import RocketPyDecoder, RocketPyEncoder
10-
119
from rocketpy.tools import from_hex_decode
1210

1311

12+
# pylint: disable=unused-argument
1413
@patch("matplotlib.pyplot.show")
1514
@pytest.mark.parametrize(
1615
["flight_name", "include_outputs"],

tests/integration/test_flight.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -415,23 +415,6 @@ def test_air_brakes_flight(mock_show, flight_calisto_air_brakes): # pylint: dis
415415
test_flight = flight_calisto_air_brakes
416416
air_brakes = test_flight.rocket.air_brakes[0]
417417

418-
import json
419-
from rocketpy._encoders import RocketPyEncoder, RocketPyDecoder
420-
421-
with open("test_decode_airbrake.json", "w") as f:
422-
json.dump(
423-
test_flight,
424-
f,
425-
cls=RocketPyEncoder,
426-
indent=2,
427-
discretize=True,
428-
include_outputs=False,
429-
allow_pickle=True,
430-
)
431-
with open("test_decode_airbrake.json", "r") as f:
432-
test_flight = json.load(f, cls=RocketPyDecoder)
433-
air_brakes = test_flight.rocket.air_brakes[0]
434-
435418
assert air_brakes.plots.all() is None
436419
assert air_brakes.prints.all() is None
437420

0 commit comments

Comments
 (0)