X Tutup
Skip to content

BUG: flight.prints.max_values() fails when launching an EmptyMotor#438

Merged
Gui-FernandesBR merged 3 commits intomasterfrom
bug/flight-print-max-accel
Oct 14, 2023
Merged

BUG: flight.prints.max_values() fails when launching an EmptyMotor#438
Gui-FernandesBR merged 3 commits intomasterfrom
bug/flight-print-max-accel

Conversation

@Gui-FernandesBR
Copy link
Member

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest --runslow) have passed locally

Current behavior

  • I'm getting an error when initializing a flight object using a motor that has an burn_out_time lower than the initial time step.
  • The error happens when trying to access the max acceleration during the burn time
  • This is particularly common for deployable or multi-stage flight simulations.
  • ValueError: attempt to get argmax of an empty sequence

New behavior

A simple code line solved the problem, and I added a simple test to avoid getting this problem again.

Breaking change

  • No

Additional information

Enter text here...

- This happens when we use EmptyMotors
- ValueError: attempt to get argmax of an empty sequence
Copy link
Member

@giovaniceotto giovaniceotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix @Gui-FernandesBR. Nice touch adding a test to make sure we don't experience this again.

@Gui-FernandesBR Gui-FernandesBR merged commit 0d00797 into master Oct 14, 2023
@Gui-FernandesBR Gui-FernandesBR deleted the bug/flight-print-max-accel branch October 14, 2023 22:57
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup