8000 __array_function__ overrides for functions in numpy.testing? · Issue #13588 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

__array_function__ overrides for functions in numpy.testing? #13588

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
shoyer opened this issue May 19, 2019 · 6 comments
Closed

__array_function__ overrides for functions in numpy.testing? #13588

shoyer opened this issue May 19, 2019 · 6 comments

Comments

@shoyer
Copy link
Member
shoyer commented May 19, 2019

xref #12028

For example, consider np.testing.assert_allclose. Should these functions check for __array_function__ overrides?

I think the answer is almost certainly yes, this module was simply overlooked when I was implementing overrides.

@seberg
Copy link
Member
seberg commented May 20, 2019

Not quite sure how important it is. In testing you usually know what type of object you expect, so there seems to be less need for duckarray agnostic code? OTOH, it might make some tests much nicer to write.

@seberg
Copy link
Member
seberg commented May 23, 2019

@shoyer this is not a blocker for 1.17 right, otherwise maybe add a milestone, or even assign me?

@shoyer shoyer added this to the 1.17.0 release milestone May 24, 2019
@shoyer
Copy link
Member Author
shoyer commented May 24, 2019

I think we should try to make a decision on it prior to the 1.17 release. It will be harder to switch this after we’ve turned on overrides for other code, due to our current “all or nothing” approach to overrides with __array_function__.

@mattip
Copy link
Member
mattip commented Jun 11, 2019

Decision needed: is this a release blocker? I think not, we can always add checks to misisng functions later for this still experimental feature. It may be nice to have if someone has the time to implement and test

@shoyer
Copy link
Member Author
shoyer commented Jun 11, 2019

I've thought a little more about this and agree that it should not be a release blocker. It would not be hard to add this (I have a local branch implementing it), but it does make things a little more complicated for testing duck arrays without clear benefits. As Sebastian notes, duck typing doesn't add much (if any) value for tests, since you know what sort of arrays you're working with.

@mattip mattip removed this from the 1.17.0 release milestone Jun 11, 2019
@seberg
Copy link
Member
seberg commented Nov 18, 2019

@shoyer I will close this, with the resolution being that we do not want to add overrides to numpy.testing.

@seberg seberg closed this as completed Nov 18, 2019
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

No branches or pull requests

3 participants
0