BUG: report missing impact roots explicitly - #1148
Merged
Gui-FernandesBR merged 1 commit intoAug 14, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1148 +/- ##
===========================================
+ Coverage 82.18% 83.29% +1.11%
===========================================
Files 122 130 +8
Lines 16355 17082 +727
===========================================
+ Hits 13441 14229 +788
+ Misses 2914 2853 -61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ting-hong-shieh
marked this pull request as ready for review
August 14, 2026 02:34
Gui-FernandesBR
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Closes #1147.
Current behavior
Flight.__handle_impact_event()reports multiple valid interpolation roots explicitly, but assumes the list is non-empty before reading its first element.At merge base
cb6106a717207dd8fc2dfe1446d80ff75022f21b, a one-second step whose cubic roots are[-1 + 0j, 2 + 0j]produces:New behavior
The impact handler checks the zero-root case before indexing and reports:
This matches the existing rail-exit error style. The single-root path is unchanged, and multiple valid roots retain their existing
ValueError.At head
e511a80b2cb0c8140db6818af0dcff2245e217b0, focused tests exercise all three root counts. The single-root case also verifies impact time, velocity, phase updates, time-node updates, and solver termination.Verification
.venv/bin/python -m pytest tests/unit/simulation/test_flight.py -k handle_impact_event -q: 3 passed, 60 deselected.venv/bin/python -m pytest tests/unit/simulation/test_flight.py -q: 59 passed, 4 skipped.venv/bin/ruff check rocketpy/simulation/flight.py tests/unit/simulation/test_flight.py: passed.venv/bin/ruff format --check rocketpy/simulation/flight.py tests/unit/simulation/test_flight.py: passedgit diff --check: passedThe full integration and slow test suites were not run locally.
Environment: RocketPy 1.13.0; Python 3.12.6; NumPy 2.5.2; SciPy 1.18.0; pytest 9.1.1; Ruff 0.16.3; macOS 26.5.2 arm64.
Breaking change