Skip to content

Commit c0ea88d

Browse files
authored
Merge pull request #353 from RocketPy-Team/enh/Function-Arithmetic
Function Comparison and Identity Map
2 parents d20f77d + bd2eac1 commit c0ea88d

File tree

4 files changed

+410
-255
lines changed

4 files changed

+410
-255
lines changed

rocketpy/Flight.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
except ImportError:
2727
from .tools import cached_property
2828

29-
try:
30-
from functools import cached_property
31-
except ImportError:
32-
from .tools import cached_property
33-
3429

3530
class Flight:
3631
"""Keeps all flight information and has a method to simulate flight.
@@ -2287,7 +2282,7 @@ def maxRailButton1NormalForce(self):
22872282
if self.outOfRailTimeIndex == 0:
22882283
return 0
22892284
else:
2290-
return np.max(self.railButton1NormalForce)
2285+
return self.railButton1NormalForce.max
22912286

22922287
@cached_property
22932288
def maxRailButton1ShearForce(self):
@@ -2299,7 +2294,7 @@ def maxRailButton1ShearForce(self):
22992294
if self.outOfRailTimeIndex == 0:
23002295
return 0
23012296
else:
2302-
return np.max(self.railButton1ShearForce)
2297+
return self.railButton1ShearForce.max
23032298

23042299
@cached_property
23052300
def maxRailButton2NormalForce(self):
@@ -2311,7 +2306,7 @@ def maxRailButton2NormalForce(self):
23112306
if self.outOfRailTimeIndex == 0:
23122307
return 0
23132308
else:
2314-
return np.max(self.railButton2NormalForce)
2309+
return self.railButton2NormalForce.max
23152310

23162311
@cached_property
23172312
def maxRailButton2ShearForce(self):
@@ -2323,7 +2318,7 @@ def maxRailButton2ShearForce(self):
23232318
if self.outOfRailTimeIndex == 0:
23242319
return 0
23252320
else:
2326-
return np.max(self.railButton2ShearForce)
2321+
return self.railButton2ShearForce.max
23272322

23282323
@funcify_method(
23292324
"Time (s)", "Horizontal Distance to Launch Point (m)", "spline", "constant"

0 commit comments

Comments
 (0)