This is to start a thread about coordinating unit efforts across domains. My hope is that we at least keep each other in the loop about any developments, since there may be multiple pushes for units:
- The pangeo community, mainly based on
pint
and possibly to try out NEP 42 - The astropy community with
astropy.units
- And the start from the thread Advice and guidance about Array API for a units package - #8 by rgommers
I am not sure that it will be possible to have truly unified Quantity implementations across domains (or array-like objects), but it may be nice to ensure that e.g. whatever the pangeo community adopts is not too limited for the astro community.
(At least I would be interested in whether the e.g. pint
unit system is sufficient for the astropy community, or if there are real differences between pint
and astropy.units
.)
One thing that I have wondered is whether we can have a shared Unit
implementation (with largely shared unit conversion infrastructure and many of the end-user API choices being similar). Ideally a shared Python object, but maybe also just a shared database (possibly even using something like the gnu units database?).
Could quantity.unit
be identical for all “Quantity” implementations in theory, whether they are actually NumPy array subclasses or xarray
based? The main problem is that maybe [1, 2, 3] << unit
can’t work (unless we can agree on a “simple” quantity implementation). But xarray << unit
still can, so I am not sure that would be bad in practice.