The Array API Standard makes it feasible to create libraries that transform any standard-compatible namespace into a new standard-compatible namespace with additional features. For instance, marray
adds mask support (like np.ma
does for NumPy) to standard-compatible array libraries, and quantity-array
adds unit awareness (like pint
does for NumPy).
For convenience, marray
supports a syntax like:
from marray import torch as mxp
In this example, mxp
is a standard-compatible namespace that adds masks to PyTorch tensors.
But as discussed in UI: import namespaces with dots · Issue #91 · mdhaber/marray · GitHub, there are reasons to support a function-based interface like:
import torch as xp
import marray
mxp = marray.function_name_here(xp)
The question is what to call this function (function_name_here
above), which accepts a namespace and returns a modified namespace. I ask the broader community because this sets a precedent for similar libraries, so we’d like to choose a good name.
Thoughts? Feel free to discuss here or join the discussion in UI: import namespaces with dots · Issue #91 · mdhaber/marray · GitHub.
Thanks!
Matt