Skip to content

Commit

Permalink
Remove/clarify references to numpy.array_api
Browse files Browse the repository at this point in the history
Superseded by third-party array-api-strict library
  • Loading branch information
honno committed Feb 28, 2024
1 parent 4dc3de8 commit 79be205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hypothesis-python/docs/numpy.rst
Expand Up @@ -63,7 +63,7 @@ Hypothesis offers strategies for `Array API <https://data-apis.org/>`_ adopting
libraries in the ``hypothesis.extra.array_api`` package. See :issue:`3037` for
more details. If you want to test with :pypi:`CuPy`, :pypi:`Dask`, :pypi:`JAX`,
:pypi:`MXNet`, :pypi:`PyTorch <torch>`, :pypi:`TensorFlow`, or :pypi:`Xarray` -
or just ``numpy.array_api`` - this is the extension for you!
or just :pypi:`NumPy` - this is the extension for you!

.. autofunction:: hypothesis.extra.array_api.make_strategies_namespace

Expand Down
7 changes: 5 additions & 2 deletions hypothesis-python/tests/array_api/README.md
Expand Up @@ -3,7 +3,7 @@ This folder contains tests for `hypothesis.extra.array_api`.
## Mocked array module

A mock of the Array API namespace exists as `mock_xp` in `extra.array_api`. This
wraps NumPy-proper to conform it to the *draft* spec, where `numpy.array_api`
wraps NumPy-proper to conform it to the *draft* spec, where `array_api_strict`
might not. This is not a fully compliant wrapper, but conforms enough for the
purposes of testing.

Expand All @@ -21,7 +21,7 @@ If neither of these, the test suite will then try resolve the variable like so:
1. If the variable matches a name of an available entry point, load said entry point.
2. If the variables matches a valid import path, import said path.

For example, to specify NumPy's Array API implementation, you could use its
For example, to specify NumPy's Array API implementation[^1], you could use its
entry point (**1.**),

HYPOTHESIS_TEST_ARRAY_API=numpy pytest tests/array_api
Expand All @@ -48,3 +48,6 @@ Otherwise the test suite will use the variable as the `api_version` argument for
In the future we intend to support running tests against multiple API versioned
namespaces, likely with an additional recognized option that infers all
supported versions.

[^1]: Note NumPy will likely remove `numpy.array_api` in the future ([NEP 56](https://github.com/numpy/numpy/pull/25542))
in favour of the third-party [`array-api-strict`](https://github.com/data-apis/array-api-strict) library.

0 comments on commit 79be205

Please sign in to comment.