UnitsXD: Units across Domains coordination

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:

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.

6 Likes

Just to throw another one in the mix the yt project has their own unit implementation: unyt — unyt v2.9.2 documentation

I shall forward this thread around the astropy community to get some input from people who are more knowledgeable on the units submodule.