GalacticDynamics / unxt

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

Add support for dynamical simulation unit systems (G=1 or other value) #225

Closed adrn closed 2 days ago

adrn commented 3 days ago

This is to add support for unit systems where only two of three of {length, mass, time} units need to be specified because the value of G is set to 1 (or some other value). This is analogous to Gala's SimulationUnitSystem.

For the value of G, I was originally planning to accept unxt.Quantity | float | int. But I think this needs to be a concrete value as the computed units need to be passed to unxt.units(), which under the hood calls astropy.units.Unit. So the current approach accepts astropy.units.Quantity | float | int, but now I'm thinking that this should instead require only float | int because it doesn't really make sense to allow someone to pass in a unit-ful G. That would also simplify some logic here. Thoughts?

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.11%. Comparing base (31f7560) to head (a73f9e1). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #225 +/- ## ========================================== + Coverage 96.03% 96.11% +0.07% ========================================== Files 41 41 Lines 1565 1596 +31 ========================================== + Hits 1503 1534 +31 Misses 62 62 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.