question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: Listing of all numpy functions that support __array_function__

See original GitHub issue

Is there a listing of all numpy functions one would need to wrap to fully support all of the API that is wrappable via __array_function__? This seems like something that could be generated by introspection on the numpy source code and included in the numpy documentation, as far as I can see it doesn’t exist.

Having such a document to look at would make it much easier for downstream projects to add __array_function__ support. See https://github.com/yt-project/unyt/issues/139 for more details of my usage.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
mhvkcommented, Nov 3, 2022

I like np.testing.overrides. I’d suggest having both implementation-independent functions that allow one to check whether a function can be overridden (say, overrides.allows_array_ufunc_override, overrides.allow_array_function_override), and exposed sets of all functions that allow it (say, overrides.functions and overrides.ufuncs).

One question is how to make this discoverable. I guess with the documentation of __array_ufunc__ and __array_function__ – maybe even add it to the relevant NEPs?

2reactions
InessaPawsoncommented, Nov 3, 2022

@ngoldbaum We discussed your request at today’s triage meeting. The NumPy dev team would like to help downstream projects to add __array_function__ support. What would be the best format to share the list of these functions with your project?

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy.array — NumPy v1.24 Manual
Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__...
Read more >
NumPy quickstart — NumPy v1.24 Manual
It demonstrates how n-dimensional ( n >= 2 ) arrays are represented and can be manipulated. In particular, if you don't know how...
Read more >
Mathematical functions — NumPy v1.24 Manual
Calculate the exponential of all elements in the input array. expm1 (x, /[, out, where, casting, order, ...]) Calculate exp(x) - 1 for...
Read more >
NEP 18 — A dispatch mechanism for NumPy's high level array ...
We would like a protocol that allows arguments of a NumPy function to take control and divert execution to another function (for example...
Read more >
numpy.ndarray — NumPy v1.24 Manual
Shape of created array. dtypedata-type, optional. Any object that can be interpreted as a numpy data type. bufferobject exposing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found