Skip to content

Commit

Permalink
BUG: cannot print max_acceleration_power_on_time
Browse files Browse the repository at this point in the history
- This happens when we use EmptyMotors
- ValueError: attempt to get argmax of an empty sequence
  • Loading branch information
Gui-FernandesBR committed Oct 13, 2023
1 parent dfee9fe commit 8e17379
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2137,6 +2137,9 @@ def max_acceleration_power_on_time(self):
burn_out_time_index = find_closest(
self.acceleration.source[:, 0], self.rocket.motor.burn_out_time
)
if burn_out_time_index == 0:
return 0 # the burn out time is before the first time step

max_acceleration_time_index = np.argmax(
self.acceleration[:burn_out_time_index, 1]
)
Expand Down

0 comments on commit 8e17379

Please sign in to comment.