MAINT: remove numpy.array_api module#25911
Conversation
There was a problem hiding this comment.
I've linked to this document in quite a few places. Obviously with numpy 2.0, most of what was here is no longer true. Is it worth keeping the contents here around somewhere (maybe in the array-api-strict docs)?
There was a problem hiding this comment.
It will remain available at https://numpy.org/doc/1.26/reference/array_api.html#table-of-differences-between-numpy-array-api-and-numpy. How about I add that link to this page?
There was a problem hiding this comment.
Added a link to NEP 47, and cross-linked NEP 47 and 56.
I'll also have to follow up on the mailing list about changing the status of NEPs (superseded, accepted).
| main ``numpy`` namespace would not need to change in any way to be | ||
| spec-compatible for these. | ||
| NumPy installs an `entry point <https://packaging.python.org/en/latest/specifications/entry-points/>`__ | ||
| that can be used for discovery purposes:: |
There was a problem hiding this comment.
I never noticed that this was actually added to the standard. I should probably add it to array-api-compat and array-api-strict.
There was a problem hiding this comment.
It's marked as optional and not in the API docs, since it isn't actually an API but a packaging thing. Maybe we should improve its visibility though?
|
Obviously +1 to the overall change here. I don't know how NEPs work, but should the NEP that proposed numpy.array_api be updated? |
Good point, I'll mark it as superseded and add a little note. |
|
The macos failure seems relevant from the log |
|
For the test failure on macOS, what is happening is that the entrypoint is not installed by |
This submodule was added in NumPy 1.22 under an experimental label. After gaining experience with it, we decided that it was quite useful for testing code in downstream libraries and from end users written against the array API standard, but not for production code. Now that we have array API standard support in the main namespace, we therefore decided to remove this submodule - as documented in NEP 56 The code from `numpy.array_api` was moved to the `array-api-strict` package (see https://github.com/data-apis/array-api-strict) and further improved there. Users are advised to start using that standalone package for testing their code if they want to check that it works not only with `numpy` but with other libraries that support the array API standard. This commit also updates the entrypoint (used by for example `hypothesis`) to point to the main namespace. Users of this entrypoint to obtain NumPy's compliant namespace should not be affected by this change. [skip cirrus]
ba6a867 to
9df3add
Compare
| # This isn't a problem except for when running tests with `spin` or an | ||
| # in-place build. | ||
| return | ||
|
|
|
CI is happy aside from an unrelated connection issue on the FreeBSD job. PyPy is still running but also happy so far and passed on the last run already. Let's call it good. Thanks for the reviews Matti and Aaron! |
This submodule was added in NumPy 1.22 under an experimental label. After gaining experience with it, we decided that it was quite useful for testing code in downstream libraries and from end users written against the array API standard, but not for production code. Now that we have array API standard support in the main namespace, we therefore decided to remove this submodule - as documented in NEP 56.
The code from
numpy.array_apiwas moved to thearray-api-strictpackage (see https://github.com/data-apis/array-api-strict) and further improved there. Users are advised to start using that standalone package for testing their code if they want to check that it works not only withnumpybut with other libraries that support the array API standard.This commit also updates the entrypoint (used by for example
hypothesis) to point to the main namespace. Users of this entrypoint to obtain NumPy's compliant namespace should not be affected by this change.