Skip to content

Commit 7e37cb0

Browse files
make lint
1 parent a9beb22 commit 7e37cb0

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

rocketpy/rocket/aero_surface/fins/fin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def compute_forces_and_moments(
336336
cp,
337337
omega,
338338
*args,
339-
): # pylint: disable=arguments-differ
339+
): # pylint: disable=arguments-differ,unused-argument
340340
"""Computes the forces and moments acting on the aerodynamic surface.
341341
342342
Parameters

rocketpy/utilities.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from datetime import date
66
from importlib.metadata import version
77
from pathlib import Path
8+
from typing import TYPE_CHECKING
89

910
import matplotlib.pyplot as plt
1011
import numpy as np
@@ -16,7 +17,9 @@
1617
from .mathutils.function import Function
1718
from .plots.plot_helpers import show_or_save_plot
1819
from .rocket.aero_surface import TrapezoidalFins
19-
from .simulation.flight import Flight
20+
21+
if TYPE_CHECKING: # pragma: no cover
22+
from .simulation.flight import Flight
2023

2124

2225
def compute_cd_s_from_drop_test(
@@ -524,6 +527,9 @@ def apogee_by_mass(flight, min_mass, max_mass, points=10, plot=True):
524527
Function object containing the estimated apogee as a function of the
525528
rocket's mass (without motor nor propellant).
526529
"""
530+
# Imported lazily to avoid a circular import (Flight imports utilities).
531+
from .simulation.flight import Flight # pylint: disable=import-outside-toplevel
532+
527533
rocket = flight.rocket
528534

529535
def apogee(mass):
@@ -594,6 +600,9 @@ def liftoff_speed_by_mass(flight, min_mass, max_mass, points=10, plot=True):
594600
Function object containing the estimated liftoff speed as a function of
595601
the rocket's mass (without motor nor propellant).
596602
"""
603+
# Imported lazily to avoid a circular import (Flight imports utilities).
604+
from .simulation.flight import Flight # pylint: disable=import-outside-toplevel
605+
597606
rocket = flight.rocket
598607

599608
def liftoff_speed(mass):
@@ -652,7 +661,7 @@ def get_instance_attributes(instance):
652661
return attributes_dict
653662

654663

655-
def save_to_rpy(flight: Flight, filename: str, include_outputs=False):
664+
def save_to_rpy(flight: "Flight", filename: str, include_outputs=False):
656665
"""Saves a .rpy file into the given path, containing key simulation
657666
informations to reproduce the results.
658667

tests/unit/test_parachute_triggers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def derivative_func(_t, _y):
122122

123123
recorded = {}
124124

125-
def user_trigger(pressure, altitude, state, sensor_list, state_derivative):
125+
def user_trigger( # pylint: disable=unused-argument
126+
pressure, altitude, state, sensor_list, state_derivative
127+
):
126128
recorded["u_dot"] = (
127129
None if state_derivative is None else np.array(state_derivative)
128130
)

0 commit comments

Comments
 (0)