Skip to content

Commit

Permalink
Merge pull request #18585 from data-apis/array-api
Browse files Browse the repository at this point in the history
ENH: Implementation of the NEP 47 (adopting the array API standard)
  • Loading branch information
charris committed Aug 24, 2021
2 parents a3ac75c + 7091e4c commit 098f874
Show file tree
Hide file tree
Showing 24 changed files with 3,717 additions and 3 deletions.
15 changes: 15 additions & 0 deletions doc/release/upcoming_changes/18585.new_feature.rst
@@ -0,0 +1,15 @@
Implementation of the NEP 47 (adopting the array API standard)
--------------------------------------------------------------

An initial implementation of `NEP 47`_ (adoption the array API standard) has
been added as ``numpy.array_api``. The implementation is experimental and will
issue a UserWarning on import, as the `array API standard
<https://data-apis.org/array-api/latest/index.html>`_ is still in draft state.
``numpy.array_api`` is a conforming implementation of the array API standard,
which is also minimal, meaning that only those functions and behaviors that
are required by the standard are implemented (see the NEP for more info).
Libraries wishing to make use of the array API standard are encouraged to use
``numpy.array_api`` to check that they are only using functionality that is
guaranteed to be present in standard conforming implementations.

.. _`NEP 47`: https://numpy.org/neps/nep-0047-array-api-standard.html
13 changes: 10 additions & 3 deletions numpy/_pytesttester.py
Expand Up @@ -137,13 +137,20 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
# offset verbosity. The "-q" cancels a "-v".
pytest_args += ["-q"]

# Filter out distutils cpu warnings (could be localized to
# distutils tests). ASV has problems with top level import,
# so fetch module for suppression here.
with warnings.catch_warnings():
warnings.simplefilter("always")
# Filter out distutils cpu warnings (could be localized to
# distutils tests). ASV has problems with top level import,
# so fetch module for suppression here.
from numpy.distutils import cpuinfo

with warnings.catch_warnings(record=True):
# Ignore the warning from importing the array_api submodule. This
# warning is done on import, so it would break pytest collection,
# but importing it early here prevents the warning from being
# issued when it imported again.
import numpy.array_api

# Filter out annoying import messages. Want these in both develop and
# release mode.
pytest_args += [
Expand Down

0 comments on commit 098f874

Please sign in to comment.