-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
__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
Comments
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. |
@shoyer this is not a blocker for 1.17 right, otherwise maybe add a milestone, or even assign me? |
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 |
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 |
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. |
@shoyer I will close this, with the resolution being that we do not want to add overrides to |
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.
The text was updated successfully, but these errors were encountered: