Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Mar 8, 2018

No description provided.

ahead and add some basic attributes like ``ndim``, ``shape``,
``dtype``.

Adding new abstract methods will be a bit trick, because ABCs enforce
Copy link
Member

@eric-wieser eric-wieser Mar 18, 2018

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

@eric-wieser eric-wieser Mar 18, 2018

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``?
Copy link
Member

@eric-wieser eric-wieser Mar 18, 2018

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.
Copy link
Member

@eric-wieser eric-wieser Mar 18, 2018

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?

@charris charris changed the title New NEP for identifying and coercing duck arrays NEP: New NEP for identifying and coercing duck arrays Apr 6, 2018
@charris
Copy link
Member

@charris charris commented Apr 6, 2018

Needs rebase to get rid of circleci error.

@mattip
Copy link
Member

@mattip mattip commented May 29, 2018

@njsmith should we move forward with merging this? It needs a rebase and some small fixes

@shoyer
Copy link
Member

@shoyer shoyer commented Oct 14, 2018

Maybe we can merge this in #12174 instead?

@mattip
Copy link
Member

@mattip mattip commented Oct 15, 2018

Closing in favor of #12174

@mattip mattip closed this Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants