GalacticDynamics / unxt

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

Add concept of unitsystem flags and enable overriding / extending unit systems #218

Closed adrn closed 4 days ago

adrn commented 4 days ago

This adds a new (currently not used) set of Flag types so we can dispatch on the type of unit system (will be useful for the follow-up to add a new SimulationUnitSystem). This also adds the ability to extend or override units in an existing unit system via:

>>> usys = unitsystem(...)
>>> new_usys = unitsystem(usys, u.pc, u.erg)