Caltech-IPAC / kete

Kete Solar System Survey tools
https://Caltech-IPAC.github.io/kete
BSD 3-Clause "New" or "Revised" License
12 stars 1 forks source link

Cleaning up pyo3 interface code and fixing docs #77

Closed dahlend closed 4 months ago

dahlend commented 4 months ago

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.

dahlend commented 4 months ago

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.