Skip to content

Commit 0e17ee0

Browse files
committed
BUG: parachute callbacks attribute naming.
1 parent b4885ae commit 0e17ee0

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3131
Attention: The newest changes should be on top -->
3232

3333
### Added
34-
- ENH: Discretized and No-Pickle Encoding Options [#827] (https://github.com/RocketPy-Team/RocketPy/pull/827)
35-
34+
- ENH: Controller (AirBrakes) and Sensors Encoding [#849] (https://github.com/RocketPy-Team/RocketPy/pull/849)
3635
- EHN: Addition of ensemble variable to ECMWF dictionaries [#842] (https://github.com/RocketPy-Team/RocketPy/pull/842)
3736
- ENH: Added Crop and Clip Methods to Function Class [#817](https://github.com/RocketPy-Team/RocketPy/pull/817)
3837
- DOC: Add Flight class usage documentation and update index [#841](https://github.com/RocketPy-Team/RocketPy/pull/841)

rocketpy/mathutils/function.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ def short_time_fft(
15511551
... ylabel=f"Freq. $f$ in Hz)",
15521552
... xlim=(t_lo, t_hi)
15531553
... )
1554-
# >>> _ = ax1.plot(t_x, f_i, 'r--', alpha=.5, label='$f_i(t)$')
1554+
>>> _ = ax1.plot(t_x, f_i, 'r--', alpha=.5, label='$f_i(t)$')
15551555
>>> _ = fig1.colorbar(im1, label="Magnitude $|S_x(t, f)|$")
15561556
>>> # Shade areas where window slices stick out to the side
15571557
>>> for t0_, t1_ in [(t_lo, 1), (49, t_hi)]:
@@ -1856,7 +1856,8 @@ def plot_1d( # pylint: disable=too-many-statements
18561856
None
18571857
"""
18581858
# Define a mesh and y values at mesh nodes for plotting
1859-
fig, ax = plt.subplots()
1859+
fig = plt.figure()
1860+
ax = fig.axes
18601861
if self._source_type is SourceType.CALLABLE:
18611862
# Determine boundaries
18621863
domain = [0, 10]
@@ -1894,9 +1895,9 @@ def plot_1d( # pylint: disable=too-many-statements
18941895
plt.title(self.title)
18951896
plt.xlabel(self.__inputs__[0].title())
18961897
plt.ylabel(self.__outputs__[0].title())
1898+
show_or_save_plot(filename)
18971899
if return_object:
18981900
return fig, ax
1899-
show_or_save_plot(filename)
19001901

19011902
@deprecated(
19021903
reason="The `Function.plot2D` method is set to be deprecated and fully "

rocketpy/simulation/flight.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,12 +762,10 @@ def __simulate(self, verbose):
762762
lambda self, parachute_cd_s=parachute.cd_s: setattr(
763763
self, "parachute_cd_s", parachute_cd_s
764764
),
765-
lambda self,
766-
parachute_radius=parachute.parachute_radius: setattr(
765+
lambda self, parachute_radius=parachute.radius: setattr(
767766
self, "parachute_radius", parachute_radius
768767
),
769-
lambda self,
770-
parachute_height=parachute.parachute_height: setattr(
768+
lambda self, parachute_height=parachute.height: setattr(
771769
self, "parachute_height", parachute_height
772770
),
773771
lambda self, parachute_porosity=parachute.porosity: setattr(

rocketpy/tools.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ def find_obj_from_hash(obj, hash_, depth_limit=None):
13031303
----------
13041304
obj : object
13051305
Object to search.
1306-
hash_ : str
1306+
hash_ : int
13071307
Hash value to search for in the '__rpy_hash' field.
13081308
depth_limit : int, optional
13091309
Maximum depth to search recursively. If None, no limit.
@@ -1322,8 +1322,6 @@ def _search(o, current_depth):
13221322
return o
13231323

13241324
if isinstance(o, dict):
1325-
# Check if this dict has the '__rpy_hash' key
1326-
# Recurse into each value
13271325
for value in o.values():
13281326
result = _search(value, current_depth + 1)
13291327
if result is not None:
@@ -1335,7 +1333,6 @@ def _search(o, current_depth):
13351333
if result is not None:
13361334
return result
13371335

1338-
# Not a container or not matching
13391336
return None
13401337

13411338
return _search(obj, 0)

0 commit comments

Comments
 (0)