-
-
Notifications
You must be signed in to change notification settings - Fork 281
ENH: Events Class and Flight Rework #968
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
Open
MateusStano
wants to merge
63
commits into
develop
Choose a base branch
from
enh/events
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
080e316
ENH: first structure
MateusStano a927248
ENH: improve structure
MateusStano fae72c1
Merge remote-tracking branch 'origin/develop' into enh/events
MateusStano 31952a1
ENH: Add flight phase management classes for simulation
MateusStano 6e9876a
DOC: add .rst files
MateusStano 2e86a37
ENH: adapt event affect code
MateusStano 2ea45f3
ENH: class Event
MateusStano 4241ff5
ENH: first final flight refactor
MateusStano 2aabe20
DOC: improve docstrings
MateusStano 73a9985
Merge remote-tracking branch 'origin/develop' into enh/events
MateusStano 46b84ad
ENH: Refactor parachute trigger function and improve controller obser…
MateusStano 4786f28
DOC: remove noise usage in docs and tests
MateusStano dfbba5d
ENH: optimize simulation speed
MateusStano 33b98b0
ENH: imrpove plots and prints
MateusStano 968dad4
DOC: improve/fix docs
MateusStano 737bc98
MNT: pylint
MateusStano d954278
DOC: sensor docs
MateusStano 97b5e90
TST: add tests
MateusStano 7cb5b60
ENH: sensor data access via the Flight class, with prints, plots and …
MateusStano 4cdf2b1
DOC: revert forecast.rst changes
MateusStano a1b4be9
MNT: ruff lint
MateusStano 91e2130
TST: fix get_controller_observed_variables test
MateusStano dc12d23
MNT: pylint
MateusStano 8f95df6
MNT: pylint
MateusStano 5fff32c
DOC: add event class to references
MateusStano 26de931
MNT: schedule the new deprecations for removal in v1.16
MateusStano 05f4d55
DOC: describe the sensors and step_size trigger context keys correctly
MateusStano a9bac96
ENH: add Solution, SolutionSegment, StateSchema and StateView
MateusStano c13b417
TST: unit tests for the solution module
MateusStano 63d5963
ENH: add internal _Dynamics wrapper and instances
MateusStano 389a471
ENH: adopt Solution and _Dynamics in the flight pipeline
MateusStano 7da2785
ENH: rebuild post-processed variables from per-segment derived buffers
MateusStano a7dae38
ENH: reduce parachute descent to a 6-state dynamics
MateusStano 82c5249
ENH: deprecate solution_array, get_solution_at_time and the raw export
MateusStano 06bb8f2
DOC: document the Solution container and canonical state guarantees
MateusStano 3fff736
MNT: lint sweep for the solution refactor
MateusStano 9c6c0cc
TST: build a real Solution in the core-event-builder integration test
MateusStano d0b1448
ENH: store the flight solution as per-phase states and derived quanti…
MateusStano 3c9e4e8
ENH: flatten Solution onto one row list
MateusStano 733615a
ENH: move the recorded post-process rows into Solution
MateusStano f64aea7
BUG: read the last state through the phase that owns it
MateusStano f88fd9b
ENH: read a single solution value without building a state dict
MateusStano ad349f9
DOC: document the flat solution layout
MateusStano 210a805
MNT: make the solution phase record internal
MateusStano 85943b3
STY: strip trailing whitespace from the phase dynamics docstring
MateusStano 78d53d9
MNT: call the post-process entries values, not rows
MateusStano 393d20a
MNT: drop the reader for a solution layout that never shipped
MateusStano f9e11bf
ENH: simplify the exact-time solvers to one function per method
MateusStano 12841cd
MNT: simplify _PhaseDynamics to a single canonical mapping
MateusStano 269f66e
MNT: keep Solution to simple reads, with private writes
MateusStano e042aff
ENH: pass the event context object to triggers and callbacks
MateusStano e49bae6
BUG: fly the lag before a new flight phase begins
MateusStano 20a7646
BUG: use the angular rates in the solid propulsion equations of motion
MateusStano 23bdc56
DOC: finish moving the docs to the event context convention
MateusStano 517f7f9
DOC: add a flowchart of the simulation loop and pin the gate order
MateusStano d7490a1
DOC: say the solid propulsion equations are only valid for solid motors
MateusStano 988bddf
DOC: drop the simulation loop flowchart and its mermaid dependency
MateusStano 79a4f72
BUG: keep the quadratic roots accurate in find_roots_cubic_function
MateusStano 67cbf13
BUG: find exact event times reliably and explain failed searches
MateusStano 0a72660
BUG: stop the solver at motor ignition and burnout (#411)
MateusStano dd0d9ed
BUG: rebuild a loaded phase's canonical states from its dynamics
MateusStano 44e188f
BUG: match a 13-value atol to a phase's states by name
MateusStano 848d426
DOC: describe what each parameter is, not what other code does with it
MateusStano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Event Class | ||
| ----------- | ||
|
|
||
| .. autoclass:: rocketpy.Event | ||
| :members: |
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| Solution Classes | ||||||
| ---------------- | ||||||
|
|
||||||
| These classes hold the state history produced by a :class:`rocketpy.Flight` | ||||||
| simulation. They are not part of RocketPy's top-level namespace; a flight's | ||||||
| solution is reached through :attr:`Flight.solution <rocketpy.Flight.solution>`. | ||||||
|
|
||||||
| The ``Solution`` holds every row of the flight in one list, in the order they | ||||||
| were flown. The flight phases sit alongside it, each saying where its own rows | ||||||
| begin. So a row is read from the solution, and a phase tells you what that row | ||||||
| means:: | ||||||
|
|
||||||
| for index, phase in enumerate(flight.solution.phases): | ||||||
| start, stop = flight.solution.phase_span(index) | ||||||
| print(phase.name, stop - start) | ||||||
|
|
||||||
| :meth:`Solution.phase_span` gives where a phase's rows begin and end, so | ||||||
| ``flight.solution[start:stop]``, ``flight.solution["vz"][start:stop]`` and | ||||||
| ``flight.solution.canonical_array[start:stop]`` read just that phase. | ||||||
|
|
||||||
| .. autoclass:: rocketpy.simulation.solution.Solution | ||||||
| :members: | ||||||
|
|
||||||
| Post-process variables | ||||||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|
|
||||||
| On its way to each state derivative, a flight phase works out quantities it | ||||||
| never integrates: the accelerations, the aerodynamic forces and moments, and | ||||||
| the net thrust. Read them through ``flight.solution.post``:: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| post = flight.solution.post | ||||||
| post.names # every variable this flight computes | ||||||
| post["az"] # its [t, value] history over the whole flight | ||||||
| post.at(3.0) # every variable at the nearest stored time | ||||||
|
|
||||||
| The same values back the flight's own :attr:`Flight.az <rocketpy.Flight.az>` | ||||||
| and its companions, which wrap them as a | ||||||
| :class:`Function <rocketpy.Function>` so they can be plotted and evaluated at | ||||||
| any time. Reach for ``post`` when you want the values exactly as the simulation | ||||||
| stored them, without interpolation. | ||||||
|
|
||||||
| .. autoclass:: rocketpy.simulation.solution.PostProcessSolution | ||||||
| :members: | ||||||
|
|
||||||
| The phase objects themselves are internal to RocketPy for now, so their shape | ||||||
| may change between releases. These are the values worth reading off one: | ||||||
|
|
||||||
| ``name`` | ||||||
| The phase's name, such as ``"rail"`` or ``"free_flight"``. | ||||||
| ``t_start`` | ||||||
| The time the phase began, in seconds. | ||||||
| ``start`` | ||||||
| Where the phase's first row sits in the solution's rows. | ||||||
| ``dynamics.states`` | ||||||
| The states the phase integrated, in the order it stored them. | ||||||
| ``dynamics.name`` | ||||||
| The kind of phase it was. | ||||||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Accelerometer Class | ||
| ------------------- | ||
|
|
||
| .. autoclass:: rocketpy.sensors.Accelerometer | ||
| .. autoclass:: rocketpy.Accelerometer | ||
| :members: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Barometer Class | ||
| --------------- | ||
|
|
||
| .. autoclass:: rocketpy.sensors.Barometer | ||
| .. autoclass:: rocketpy.Barometer | ||
| :members: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| GNSS Receiver Class | ||
| ------------------- | ||
|
|
||
| .. autoclass:: rocketpy.sensors.GnssReceiver | ||
| .. autoclass:: rocketpy.GnssReceiver | ||
| :members: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Gyroscope Class | ||
| --------------- | ||
|
|
||
| .. autoclass:: rocketpy.sensors.Gyroscope | ||
| .. autoclass:: rocketpy.Gyroscope | ||
| :members: |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.