Add Event class as foundation for deployables and multistage simulation#8
Draft
Add Event class as foundation for deployables and multistage simulation#8
Conversation
Co-authored-by: aZira371 <99824864+aZira371@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add new event class for deployables and multistage implementation
Add Event class as foundation for deployables and multistage simulation
Mar 15, 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
Checklist
pytest tests -m slow --runslow) have passed locallyCurrent behavior
Flight events (parachute deployments) are stored as raw
[time, parachute]two-element lists inFlight.parachute_events. There is no structured type to represent discrete simulation events, making it impossible to cleanly extend the system for stage separations, deployable releases, or other future event types.New behavior
Introduces
Event— a lightweight class inrocketpy/simulation/event.py— to represent any discrete occurrence during a flight simulation.Why
simulation/, notrocket/?rocket/defines vehicle geometry and components (what exists).simulation/records what happens during flight (when and how components activate).Eventis created by the ODE solver insideFlight; it belongs where it's used. This also keeps it reusable for futureMonteCarloand multistage managers without circular imports.Key attributes:
timetriggerParachute.trigger)event_type"parachute","stage_separation","deployable", etc.actionParachutethat deployed)Usage:
Changes:
rocketpy/simulation/event.py— newEventclass with__repr__,__str__,__eq__, and backward-compatible__getitem__Flight.__simulate()— both parachute trigger paths now appendEventobjects instead of raw listsflight_prints.py— updated to useevent.time/event.actionattributesrocketpy/simulation/__init__.py,rocketpy/__init__.py—Eventis publicly exportedtests/unit/simulation/test_event.py— 24 unit testsBreaking change
Existing code accessing
parachute_events[i][0](time) orparachute_events[i][1](parachute) continues to work viaEvent.__getitem__.Additional information
This is the first building block toward the deployables and multistage plan. The
event_typestring field is intentionally open-ended so future separation events ("stage_separation","deployable") slot in without changing the class interface.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
github-production-user-asset-6210df.s3.amazonaws.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.