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

DOC: add Array API Standard support directive #21933

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Nov 24, 2024

Reference issue

gh-17597
gh-21255

What does this implement/fix?

This adds an admonition that advertises support for non-NumPy backends.

Additional information

Just an experiment; it's up for debate whether we want to do this yet.

@mdhaber mdhaber added Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org array types Items related to array API support and input array validation (see gh-18286) labels Nov 24, 2024
@mdhaber mdhaber marked this pull request as ready for review November 24, 2024 02:46
@mdhaber mdhaber removed request for andyfaff and tupui November 24, 2024 02:47
@mdhaber mdhaber marked this pull request as draft November 24, 2024 02:47
@j-bowhay
Copy link
Member

Xref #21255
I had a third idea that I had been meaning to write up but this could be a good plan in the meantime

@mdhaber
Copy link
Contributor Author

mdhaber commented Nov 24, 2024

Ah, right, I remembered a discussion but forgot it was a full issue.

Yeah, looks like this would do very little of what you want : ) It is a generic advertisement with none of the details.

I don't think an admonition would be the way to go for presenting details like the table in #21255 (comment); it is more of a way to get the word out that there's some sort of experimental support.

@j-bowhay
Copy link
Member

#21255 is not going to happen in this release so I agree this could be a good idea. Also we could probably do with updating https://scipy.github.io/devdocs/dev/api-dev/array_api.html#currently-supported-functionality

@mdhaber
Copy link
Contributor Author

mdhaber commented Nov 24, 2024

Also we could probably do with updating

I added at least a partial list of updates in the release notes.

Maybe we just include the admonitions at a module level and have it link to the list. Maybe we could add it to functions where other array types would offer big advantages, but it doesn't have to be added to every last function in stats, for instance.

@rgommers
Copy link
Member

Thanks for starting this @mdhaber. I think we need an admonition of some sort (either per module or per function), so this could be a start. The main thing is indeed how one would add details to the admonition (e.g., supported by CuPy, not by xxx). Providing a "test this please" request without those details in the 1.15.0 docs may get us a whole bunch of bug reports for things we already know don't work.

@melissawm
Copy link
Member

+1 for having an admonition that links to the complete (updated 😄 ) table in another page.

Also, the admonition as implemented here would allow for text to be defined in the body of the admonition to be appended to the default text. So something like

.. arrayapi:: function
	This function is supported by CuPy but not PyTorch.

would result in an admonition with title Array API Standard Support and body

This function has experimental support for Python Array API Standard
compatible backends other than NumPy. Please consider testing this
feature by setting an environment variable ``SCIPY_ARRAY_API=1`` and
providing PyTorch, JAX, or CuPy arrays as array arguments. See <link> for more information.
This function is supported by CuPy but not PyTorch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
array types Items related to array API support and input array validation (see gh-18286) Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants