Skip to content

Commit 5ad0f0b

Browse files
committed
MNT: refactored imports and error raising to satisfy pylint
1 parent 9547238 commit 5ad0f0b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

rocketpy/utilities.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
import traceback
66
import warnings
77
from datetime import date
8+
from importlib import resources
89
from importlib.metadata import version
910
from pathlib import Path
1011

1112
import matplotlib.pyplot as plt
1213
import numpy as np
1314
from scipy.integrate import solve_ivp
14-
from importlib import resources
1515

16+
from rocketpy.motors import GenericMotor
1617
from ._encoders import RocketPyDecoder, RocketPyEncoder
1718
from .environment.environment import Environment
1819
from .mathutils.function import Function
1920
from .plots.plot_helpers import show_or_save_plot
2021
from .rocket.aero_surface import TrapezoidalFins
2122
from .simulation.flight import Flight
22-
from ._encoders import RocketPyEncoder, RocketPyDecoder
23-
from rocketpy.motors import GenericMotor
2423

2524

2625
def compute_cd_s_from_drop_test(
@@ -785,8 +784,8 @@ def list_motors_dataset():
785784
try:
786785
motors_package = resources.files("rocketpy.datasets.motors")
787786
return [f.stem for f in motors_package.rglob("*.eng")]
788-
except ModuleNotFoundError:
789-
raise ImportError("The motors dataset was not found.")
787+
except ModuleNotFoundError as exc:
788+
raise ImportError("The motors dataset was not found.") from exc
790789

791790

792791
def load_motor_from_dataset(motor_name):

0 commit comments

Comments
 (0)