You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rename or alias get_namespace to array_namespace #19
Having a function array_namespace seems more intuitive than get_namespace, mainly due to symmetry with e.g. repr(), str(), iter(), next(), since array_namespace(x) returns x.__array_namespace__() if it exists, and does something sensible if it does not.
Thanks for the suggestion @ntessore. On the one hand, I can see that the name may be slightly nicer. On the other hand, this package is already past version 1.0, and the get_namespace name is already used in other places (e.g., https://numpy.org/neps/nep-0047-array-api-standard.html). So I'm not sure that this is worth the churn.
I agree it does seem like a better name to match __array_namespace__. We would probably want to keep get_namespace too if we change it just because we did already do a release with it.
I'm actually in favor of this, but I've made it as a separate PR in case there are any objections #29. I kept get_namespace as an (undocumented) backwards compatible wrapper.
Activity
rgommers commentedon Mar 5, 2023
Thanks for the suggestion @ntessore. On the one hand, I can see that the name may be slightly nicer. On the other hand, this package is already past version 1.0, and the
get_namespacename is already used in other places (e.g., https://numpy.org/neps/nep-0047-array-api-standard.html). So I'm not sure that this is worth the churn.ntessore commentedon Mar 5, 2023
That's expected, of course, but I thought I should bring this up at least while the NEP is still a draft.
asmeurer commentedon Mar 6, 2023
I agree it does seem like a better name to match
__array_namespace__. We would probably want to keepget_namespacetoo if we change it just because we did already do a release with it.Rename get_namespace to array_namespace
asmeurer commentedon Mar 8, 2023
I'm actually in favor of this, but I've made it as a separate PR in case there are any objections #29. I kept
get_namespaceas an (undocumented) backwards compatible wrapper.