GalacticDynamics / unxt

Unitful Quantities in JAX
https://unxt.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

New API and choice of units backends #139

Open nstarman opened 3 months ago

nstarman commented 3 months ago

Currently the unxt package vendors a custom Quantity (and related) object as well as a UnitSystem (and related). The actual units and their conversions are managed by Astropy. To make unxt a tool for the general ML community it would be ideal to allow the user to choose what units backend to use.

This will require a fair bit of refactoring to decouple unxt from astropy.units. Instead of directly calling astropy functions we will need to develop more generic functions which can then refer to the chosen backend. I think we should lean into multiple dispatch and therefore draw inspiration from Unitful.jl. I'm envisioning

Dimensions-related API:

Dimensions-system-related API:

Units-related API:

UnitSystem-related API:

Quantity-related API:

Support other plum API.

Planned backend support: