Skip to content

Commit 1e2a2fd

Browse files
committed
ENH: simplifying variable names
1 parent 40d10c5 commit 1e2a2fd

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

rocketpy/rocket/parachute.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class Parachute:
9292
Function of noisy_pressure_signal.
9393
Parachute.clean_pressure_signal_function : Function
9494
Function of clean_pressure_signal.
95-
Parachute.parachute_radius : float
95+
Parachute.radius : float
9696
Length of the non-unique semi-axis (radius) of the inflated hemispheroid
9797
parachute in meters.
98-
Parachute.parachute_height : float, None
98+
Parachute.height : float, None
9999
Length of the unique semi-axis (height) of the inflated hemispheroid
100100
parachute in meters.
101101
Parachute.porosity : float
@@ -111,8 +111,8 @@ def __init__(
111111
sampling_rate,
112112
lag=0,
113113
noise=(0, 0, 0),
114-
parachute_radius=1.5,
115-
parachute_height=None,
114+
radius=1.5,
115+
height=None,
116116
porosity=0.0432,
117117
):
118118
"""Initializes Parachute class.
@@ -166,11 +166,11 @@ def __init__(
166166
The values are used to add noise to the pressure signal which is
167167
passed to the trigger function. Default value is ``(0, 0, 0)``.
168168
Units are in Pa.
169-
parachute_radius : float, optional
169+
radius : float, optional
170170
Length of the non-unique semi-axis (radius) of the inflated hemispheroid
171171
parachute. Default value is 1.5.
172172
Units are in meters.
173-
parachute_height : float, optional
173+
height : float, optional
174174
Length of the unique semi-axis (height) of the inflated hemispheroid
175175
parachute. Default value is the radius of the parachute.
176176
Units are in meters.
@@ -193,8 +193,8 @@ def __init__(
193193
self.clean_pressure_signal_function = Function(0)
194194
self.noisy_pressure_signal_function = Function(0)
195195
self.noise_signal_function = Function(0)
196-
self.parachute_radius = parachute_radius
197-
self.parachute_height = parachute_height or parachute_radius
196+
self.radius = radius
197+
self.height = height or radius
198198
self.porosity = porosity
199199
self.ka = 1.068 * (
200200
1
@@ -296,8 +296,8 @@ def to_dict(self, include_outputs=False):
296296
"sampling_rate": self.sampling_rate,
297297
"lag": self.lag,
298298
"noise": self.noise,
299-
"parachute_radius": self.parachute_radius,
300-
"parachute_height": self.parachute_height,
299+
"radius": self.radius,
300+
"height": self.height,
301301
"porosity": self.porosity,
302302
}
303303

@@ -325,8 +325,8 @@ def from_dict(cls, data):
325325
sampling_rate=data["sampling_rate"],
326326
lag=data["lag"],
327327
noise=data["noise"],
328-
parachute_radius=data.get("parachute_radius", 1.5),
329-
parachute_height=data.get("parachute_height", None),
328+
radius=data.get("radius", 1.5),
329+
height=data.get("height", None),
330330
porosity=data.get("porosity", 0.0432),
331331
)
332332

rocketpy/rocket/rocket.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,8 +1440,8 @@ def add_parachute(
14401440
sampling_rate=100,
14411441
lag=0,
14421442
noise=(0, 0, 0),
1443-
parachute_radius=1.5,
1444-
parachute_height=None,
1443+
radius=1.5,
1444+
height=None,
14451445
porosity=0.0432,
14461446
):
14471447
"""Creates a new parachute, storing its parameters such as
@@ -1501,11 +1501,11 @@ def add_parachute(
15011501
The values are used to add noise to the pressure signal which is
15021502
passed to the trigger function. Default value is (0, 0, 0). Units
15031503
are in pascal.
1504-
parachute_radius : float, optional
1504+
radius : float, optional
15051505
Length of the non-unique semi-axis (radius) of the inflated hemispheroid
15061506
parachute. Default value is 1.5.
15071507
Units are in meters.
1508-
parachute_height : float, optional
1508+
height : float, optional
15091509
Length of the unique semi-axis (height) of the inflated hemispheroid
15101510
parachute. Default value is the radius of the parachute.
15111511
Units are in meters.
@@ -1528,8 +1528,8 @@ def add_parachute(
15281528
sampling_rate,
15291529
lag,
15301530
noise,
1531-
parachute_radius,
1532-
parachute_height,
1531+
radius,
1532+
height,
15331533
porosity,
15341534
)
15351535
self.parachutes.append(parachute)

rocketpy/simulation/flight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,13 +1027,13 @@ def __simulate(self, verbose):
10271027
self, "parachute_cd_s", parachute_cd_s
10281028
),
10291029
lambda self,
1030-
parachute_radius=parachute.parachute_radius: setattr(
1030+
parachute_radius=parachute.radius: setattr(
10311031
self,
10321032
"parachute_radius",
10331033
parachute_radius,
10341034
),
10351035
lambda self,
1036-
parachute_height=parachute.parachute_height: setattr(
1036+
parachute_height=parachute.height: setattr(
10371037
self,
10381038
"parachute_height",
10391039
parachute_height,

rocketpy/stochastic/stochastic_parachute.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def __init__(
3939
sampling_rate=None,
4040
lag=None,
4141
noise=None,
42-
parachute_radius=None,
43-
parachute_height=None,
42+
radius=None,
43+
height=None,
4444
porosity=None,
4545
):
4646
"""Initializes the Stochastic Parachute class.
@@ -66,9 +66,9 @@ def __init__(
6666
noise : list
6767
List of tuples in the form of (mean, standard deviation,
6868
time-correlation).
69-
parachute_radius : tuple, list, int, float
69+
radius : tuple, list, int, float
7070
Radius of the parachute in meters.
71-
parachute_height : tuple, list, int, float
71+
height : tuple, list, int, float
7272
Height of the parachute in meters.
7373
porosity : tuple, list, int, float
7474
Porosity of the parachute.
@@ -79,8 +79,8 @@ def __init__(
7979
self.sampling_rate = sampling_rate
8080
self.lag = lag
8181
self.noise = noise
82-
self.parachute_radius = parachute_radius
83-
self.parachute_height = parachute_height
82+
self.radius = radius
83+
self.height = height
8484
self.porosity = porosity
8585

8686
self._validate_trigger(trigger)
@@ -93,8 +93,8 @@ def __init__(
9393
lag=lag,
9494
noise=noise,
9595
name=None,
96-
parachute_radius=parachute_radius,
97-
parachute_height=parachute_height,
96+
radius=radius,
97+
height=height,
9898
porosity=porosity,
9999
)
100100

0 commit comments

Comments
 (0)