Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 14, 2023

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.

tests/test_flight.py Show resolved Hide resolved
@Gui-FernandesBR Gui-FernandesBR merged commit 0d00797 into master Oct 14, 2023
1 check passed
@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