Skip to content

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

Open
thatrandomasiandev wants to merge 1 commit into
RocketPy-Team:developfrom
thatrandomasiandev:enh/758-post-sim-step-callback
Open

ENH: add Flight post-step callback across all phases (#758)#1128
thatrandomasiandev wants to merge 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
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.

1 participant