Skip to content
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

Initial Python bindings #114

Merged
merged 83 commits into from
Mar 14, 2023
Merged

Initial Python bindings #114

merged 83 commits into from
Mar 14, 2023

Conversation

ChristopherRabotin
Copy link
Member

@ChristopherRabotin ChristopherRabotin commented Feb 11, 2023

Status

Early draft, pull request is opened mostly to run through the test suite, closes #93 .

What's left for the next demo of Styx to run a whole simulated OD from a Python workflow.

  • Build a Python interface to a TrackingArcSim<Spacecraft, StdMeasurement, GroundStation> to be able to generate measurements from Python and the proxy functions for generating the measurements (requires loading a trajectory)
  • Build the bindings to initialize a Ground Station from the YAML (via the StationSerde which implements the Configurable trait)
  • Build a structure to store the measurements into an in-memory and in-parquet file after calling generate_measurements in the simulated tracking arc
  • Load such file and rebuild that structure from Rust and Python
  • Update ODP to use the measurement structure (which is shared between simulated and real measurements)
  • Export the new Traj<S> to parquet (useful for plotting and required for setting up a TrackingArcSim)
  • Import a trajectory parquet file from Python

Then:

  • Migrate Orbit and Spacecraft state definitions from Thomas' work (worked out of the box!)
  • Implement Configurable for Orbit and Spacecraft to build each from a YAML
  • Implement Configurable for propagator and dynamics (should be similar to current set up with Config.rs). I think it's much easier to set this up from YAML than from the Python directly. It's also easier to pass around between functions I think but I may be wrong here. @thomasantony if you have insights or a preference, let me know. The use-case I have in mind is to set up a mission design or orbit determination run just like one would set up a machine learning experiments following a "data engineering convention" approach
  • Implement Configurable for OD process to set up an OD process from YAML & Python Instead, the OD process is set up manually, cf. tests/python/test_orbit_determination.py .
  • Event searching in Python propagation

Soon thereafter:

Effects

  • Adds Python bindings to Nyx, huge thanks to @thomasantony who coded this up years ago and I didn't get around to merging it.
  • Updates version to 2.0.0-alpha.0

If this change adds or modifies a validation case

@ChristopherRabotin ChristopherRabotin added Status: Development Issue at Test Driven Development phase of the quality assurance process Kind: New feature This is a proposed new feature Interface: Python Priority: high labels Feb 11, 2023
Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
Will be used to configure structures from YAML or TOML files. This is mostly cleaning up the scenario stuff, but it will be useful for stream lining cofings

Signed-off-by: Christopher Rabotin <[email protected]>
Used only by commercial entities

Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
This will allow more flexibility in the definition of tracking schedules, and ensure repeatability. Soon enough, we'll have FOGM models too.

Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
If I end up implementing another gravity model, it won't be using spherical harmonics.

This future proofed design was to allow for another backend, and that was obviously a bad call.

Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
Signed-off-by: Christopher Rabotin <[email protected]>
Anything more complicated than coast and thrust should be encapsulated
into a state machine. This would also enable hybrid automatons
Signed-off-by: Christopher Rabotin <[email protected]>
This simplifies the initialization of the spacecraft from YAML. Also
allows specifying the guidance mode.
I seem to have broken something important in the propagation not sure what
And try to fix the Python testing

Signed-off-by: Christopher Rabotin <[email protected]>
@ChristopherRabotin ChristopherRabotin added Status: Final review Issue at Review phase of the quality assurance process and removed Status: Development Issue at Test Driven Development phase of the quality assurance process labels Mar 10, 2023
Signed-off-by: Christopher Rabotin <[email protected]>
The s390x platform would have issues loading a trajectory stored as
parquet (although it was created in the same script). MacOS on aarach64
does not build (but works fine on x86 64).
+ Can now load orbit estimations with covariances
+ Started refactoring ODProcess to remove some generics (will eventually fully transition to TrackingArc)
+ Removed ODP from scenarios (scenarios will be removed entirely in favor of Python interface)

Signed-off-by: Christopher Rabotin <[email protected]>
I tend to add this for rust-analyzer and forget about it

Signed-off-by: Christopher Rabotin <[email protected]>
It's super hacky, but it should work.

Will add a test soon

Signed-off-by: Christopher Rabotin <[email protected]>
@ChristopherRabotin ChristopherRabotin merged commit 4afb1fa into master Mar 14, 2023
@ChristopherRabotin ChristopherRabotin deleted the ta/pyo3-bindings branch March 14, 2023 05:25
@ChristopherRabotin ChristopherRabotin changed the title [Draft] Python bindings Initial Python bindings Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interface: Python Kind: New feature This is a proposed new feature Priority: high Status: Final review Issue at Review phase of the quality assurance process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python interface for mission design and orbit determination
2 participants