-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add Array API inspection utilities #689
Conversation
This looks pretty good to me overall, thanks @kgryte. |
I've updated this PR to use a protocol instead of a data class. I believe this PR should be ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this PR is written and without looking at the linked discussions, it's not quite clear to me whether __array_namespace_info__
is an array method or a function in the namespace returned by array.__array_namespace__
.
In addition, it could be useful to clarify in the __array_namespace_info__
docs that the returned object from that function/method may be either a namespace or a class; as long as the user can do this:
info = __array_namespace_info__()
info.capabilities()
info.devices()
info.dtypes()
info.default_dtypes()
IIRC there were a few more things discussed for inclusion in the inspection API:
|
I was planning on submitting follow-up PR(s) to avoid potential bikesheds and avoid piggybacking on this PR, but I can include some of the aforementioned additional capabilities in this PR. I don't have a strong opinion, except wanting to get this in sooner rather than later. |
@rgommers The updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from my perspective. I'm keen to see this PR merged so that we can start addressing follow-up works (ex: #689 (comment)).
Ping @oleksandr-pavlyk for review, due to its relevance 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too now, modulo the one typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two nits on formatting, but content-wise we're good to go!
Co-authored-by: Leo Fang <[email protected]>
Thanks to Athan for driving this and all for help! |
This PR