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

Cleaning up pyo3 interface code and fixing docs #77

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

dahlend
Copy link
Collaborator

@dahlend dahlend commented Jul 16, 2024

I went in just to fix a documentation error on the Time class, but this ended up being a bit of a rabbit hole.

This bumps the version of Pyo3 up to a more recent one, which caused a lot of knock-on effects. These led to having to update a fairly large chunk of the interface code, which was a significant improvements.

Details:

This also removed 2 intermediate enums on the rust side which only existed to allow polymorphic input support for the rust functions. These got replaced by custom FromPyObject pyo3 trait implementations, and I think overall made the code much cleaner.

@@ -21,78 +21,6 @@
]


def propagate_n_body(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these wrappers are removed and now completely live inside rust.

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 16, 2024

A minor improvement I have also added is that impacts now report their UTC TIme:

Impact detected between Name("2008 TC3") <-> earth at time 2454746.6261684843 (2008-10-07T03:00:35.773+00:00)
Impact detected between Name("2014 AA") <-> earth at time 2456659.5957518844 (2014-01-02T02:16:45.778+00:00)
Impact detected between Name("2018 LA") <-> earth at time 2458272.2342101773 (2018-06-02T17:36:06.575+00:00)
Impact detected between Name("2019 MO") <-> earth at time 2458657.3989379713 (2019-06-22T21:33:19.056+00:00)
Impact detected between Name("2022 EB5") <-> earth at time 2459650.385320947 (2022-03-11T21:13:42.545+00:00)
Impact detected between Name("2022 WJ1") <-> earth at time 2459902.852624717 (2022-11-19T08:26:37.591+00:00)
Impact detected between Name("2023 CX1") <-> earth at time 2459988.6261684843 (2023-02-13T03:00:31.773+00:00)
Impact detected between Name("2024 BX1") <-> earth at time 2460330.531542121 (2024-01-21T00:44:16.055+00:00)

These objects are small impactors which hit the earth and were briefly spotted hours before impact. The MPC carries this state information.

@dahlend dahlend merged commit d2e6f88 into main Jul 16, 2024
1 check passed
@dahlend dahlend deleted the documentation branch July 16, 2024 21:34
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