-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
NEP: New NEP for identifying and coercing duck arrays #10706
Conversation
ahead and add some basic attributes like ``ndim``, ``shape``, | ||
``dtype``. | ||
|
||
Adding new abstract methods will be a bit trick, because ABCs enforce |
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.
typo: tricky
start using it by habit without endless exhortations. | ||
|
||
One option would be to actually change ``asarray``\'s semantics so | ||
that *it* passes through ``AbstractArray`` objects unchanged. But I'm |
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.
Perhaps just change asanyarray
?
We can't use ``asanyarray`` or ``array``, since those are already | ||
taken. | ||
|
||
Any other ideas? ``np.cast``, ``np.coerce``? |
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.
np.cast[np.float16](x)
is already a thing
-------------- | ||
|
||
1. Rename ``NDArrayOperatorsMixin`` to ``AbstractArray`` (leaving | ||
behind an alias for backwards compatibility) and make it an ABC. |
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.
Why not keep them separate, and have AbstractArray
subclass the mixin? What about users who just want to use ufuncs, but no other part of the array interface?
Needs rebase to get rid of circleci error. |
@njsmith should we move forward with merging this? It needs a rebase and some small fixes |
Maybe we can merge this in #12174 instead? |
Closing in favor of #12174 |
No description provided.