Skip to content

rename or alias get_namespace to array_namespace #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ntessore opened this issue Mar 3, 2023 · 4 comments · Fixed by #29
Closed

rename or alias get_namespace to array_namespace #19

ntessore opened this issue Mar 3, 2023 · 4 comments · Fixed by #29

Comments

@ntessore
Copy link

ntessore commented Mar 3, 2023

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.

@rgommers
Copy link
Member

rgommers commented 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_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.

@ntessore
Copy link
Author

ntessore commented 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
Copy link
Member

asmeurer commented Mar 6, 2023

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.

asmeurer added a commit to asmeurer/array-api-compat that referenced this issue Mar 8, 2023
get_namespace is maintained as a backwards compatible alias.

Fixes data-apis#19.
@asmeurer
Copy link
Member

asmeurer commented 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_namespace as an (undocumented) backwards compatible wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants