-
Notifications
You must be signed in to change notification settings - Fork 483
Description
While Pint was a reasonably early adopter of NEP 18 (__array_function__
) for array type compatibility, there have been several compatibility efforts in the NumPy (and Python arrays more generally) ecosystem recently that Pint has not yet taken advantage of, particularly the open NEPs 37 and 47, and with those, the Python Array API standards. It would be wonderful to see these implemented in Pint, and I believe that it should not be too onerous of a task (at least compared to the initial NEP 18 implementation)...perhaps all that would be needed is exposing the registries of functions in https://github.com/hgrecco/pint/blob/master/pint/facets/numpy/numpy_func.py as a module, which could then be returned as appropriate in the __array_module__
and __array_namespace__
protocols? That being said, given that __array_namespace__
denotes compliance with the Python Array API, perhaps rigorous testing against the API standard should be done prior to implementing that?