-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
BUG: overridable functions from NEP 35 do not show up in ARRAY_FUNCTIONS
#27451
Comments
Thanks for the note. This should not be very hard, I think. The The solution may just be to add them manually (maybe with a decorator), and I suppose also add a test for that. Where the test may be the more interesting part even. |
I can give it a try later this week. |
Good news, it seems that many such functions are already decorated with
And here are every other NEP 35 function I could find (reading through gh-16935), which I'm guessing are all C-implemented
conveniently, this second subset still has their docstrings defined in Python and can be discovered by grepping for .replace(
"${ARRAY_FUNCTION_LIKE}",
array_function_like_doc,
)) (which is essentially an inlining of I think it's possible to resolve the problem with just some plumbing in that decorator... at least for the Python-implemented part. For the C-implemented part, I'm not sure what to do. Manually writing down the list of 12 functions somewhere is clearly the easy way out, but it's also not easily discoverable or maintainable. Adding a dedicated flag to |
Not sure that modifying |
Describe the issue:
Functions that were made dispatchable via NEP 35 (which added the
like
keyword argument) do not appear to be so using thenp.testing.overrides
API.Taking for instance np.asarray, whose
like
argument is documented asMeanwhile,
np.testing.overrides.get_overridable_numpy_array_functions
's docstring saysSince there's an API to check NEP 18 support, there should probably be one for NEP 35 too. I'm not sure wether the best route would be to extend the existing API to cover NEP 35 functions too, or if another set of functions should be added to
np.testing.overrides
.Reproduce the code example:
Error message:
Python and NumPy Versions:
Runtime Environment:
Context for the issue:
We started discussing supporting a subset of these functions in
astropy.units
(astropy/astropy#17001), but I haven't found an easy systematic way to discover the whole set (in particular because we're already testing for implementation completeness of NEP 18 functions).The text was updated successfully, but these errors were encountered: