Skip to content

ENH: add Flight post-step callback across all phases (#758) - #1128

Merged
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:enh/758-post-sim-step-callback
Aug 15, 2026
Merged

Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:enh/758-post-sim-step-callback

Conversation

@thatrandomasiandev

Copy link
Copy Markdown

Pull request type

  • Code changes (bug fix, features)

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (ruff / make lint focused files) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md — no action needed; an LLM workflow auto-updates it after merge

Current behavior

Discrete/continuous controllers are not a full-lifecycle observer: air-brake examples often terminate at apogee, and parachute phases are not meant to keep feeding actuator controllers. Users simulating ground-station / radio update code had no first-class hook that keeps running through descent.

Fixes #758

New behavior

Flight(..., post_step_callback=None) accepts an optional callable invoked once after every successful ODE solver step for the entire simulation, including parachute phases. Signature matches phase/node callbacks: callback(flight). Use flight.t and flight.y_sol for the current time and state.

Breaking change

  • No

Additional information

  • Focused unit tests assert the callback fires both before and after apogee on calisto_robust, and that non-callables raise TypeError.
  • Full slow suite not run in this contribution pass.

@thatrandomasiandev
thatrandomasiandev requested a review from a team as a code owner August 11, 2026 01:37
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.42%. Comparing base (8ba1f2f) to head (12a5199).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1128   +/-   ##
========================================
  Coverage    84.42%   84.42%           
========================================
  Files          130      130           
  Lines        17291    17296    +5     
========================================
+ Hits         14598    14603    +5     
  Misses        2693     2693           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR
Gui-FernandesBR force-pushed the enh/758-post-sim-step-callback branch from b3f5a0c to 12a5199 Compare August 15, 2026 14:44
@Gui-FernandesBR Gui-FernandesBR linked an issue Aug 15, 2026 that may be closed by this pull request
@Gui-FernandesBR
Gui-FernandesBR merged commit 826531b into RocketPy-Team:develop Aug 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Add post-simulation step callback

2 participants