diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-08-04 16:47:05 -0600 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-08-04 16:50:30 -0600 |
commit | 6e57d829cb6628610e163524f203245b247a2839 (patch) | |
tree | f15f4900f995835bbd8526d7a4918a4d776d63e2 | |
parent | 1596415c32f6008fcacc14a3a5394787aeb44265 (diff) | |
download | numpy-6e57d829cb6628610e163524f203245b247a2839.tar.gz |
Rename numpy._array_api to numpy.array_api
Instead of the leading underscore, the experimentalness of the module will be
indicated by omitting a warning on import. That we, we do not have to change
the API from underscore to no underscore when the module is no longer
experimental.
-rw-r--r-- | numpy/array_api/__init__.py (renamed from numpy/_array_api/__init__.py) | 6 | ||||
-rw-r--r-- | numpy/array_api/_array_object.py (renamed from numpy/_array_api/_array_object.py) | 4 | ||||
-rw-r--r-- | numpy/array_api/_constants.py (renamed from numpy/_array_api/_constants.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_creation_functions.py (renamed from numpy/_array_api/_creation_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_data_type_functions.py (renamed from numpy/_array_api/_data_type_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_dtypes.py (renamed from numpy/_array_api/_dtypes.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_elementwise_functions.py (renamed from numpy/_array_api/_elementwise_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_linear_algebra_functions.py (renamed from numpy/_array_api/_linear_algebra_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_manipulation_functions.py (renamed from numpy/_array_api/_manipulation_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_searching_functions.py (renamed from numpy/_array_api/_searching_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_set_functions.py (renamed from numpy/_array_api/_set_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_sorting_functions.py (renamed from numpy/_array_api/_sorting_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_statistical_functions.py (renamed from numpy/_array_api/_statistical_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_typing.py (renamed from numpy/_array_api/_typing.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/_utility_functions.py (renamed from numpy/_array_api/_utility_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/tests/__init__.py (renamed from numpy/_array_api/tests/__init__.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/tests/test_array_object.py (renamed from numpy/_array_api/tests/test_array_object.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/tests/test_creation_functions.py (renamed from numpy/_array_api/tests/test_creation_functions.py) | 0 | ||||
-rw-r--r-- | numpy/array_api/tests/test_elementwise_functions.py (renamed from numpy/_array_api/tests/test_elementwise_functions.py) | 0 | ||||
-rw-r--r-- | numpy/setup.py | 2 |
20 files changed, 6 insertions, 6 deletions
diff --git a/numpy/_array_api/__init__.py b/numpy/array_api/__init__.py index 57a4ff4e1..4650e3db8 100644 --- a/numpy/_array_api/__init__.py +++ b/numpy/array_api/__init__.py @@ -55,7 +55,7 @@ request. guaranteed to give a comprehensive coverage of the spec. Therefore, those reviewing this submodule should refer to the standard documents themselves. -- There is a custom array object, numpy._array_api.Array, which is returned +- There is a custom array object, numpy.array_api.Array, which is returned by all functions in this module. All functions in the array API namespace implicitly assume that they will only receive this object as input. The only way to create instances of this object is to use one of the array creation @@ -72,7 +72,7 @@ request. - Indexing: Only a subset of indices supported by NumPy are required by the spec. The Array object restricts indexing to only allow those types of indices that are required by the spec. See the docstring of the - numpy._array_api.Array._validate_indices helper function for more + numpy.array_api.Array._validate_indices helper function for more information. - Type promotion: Some type promotion rules are different in the spec. In @@ -94,7 +94,7 @@ request. objects to represent dtypes. - The wrapper functions in this module do not do any type checking for things - that would be impossible without leaving the _array_api namespace. For + that would be impossible without leaving the array_api namespace. For example, since the array API dtype objects are just the NumPy dtype objects, one could pass in a non-spec NumPy dtype into a function. diff --git a/numpy/_array_api/_array_object.py b/numpy/array_api/_array_object.py index 3ff845dd7..24957fde6 100644 --- a/numpy/_array_api/_array_object.py +++ b/numpy/array_api/_array_object.py @@ -347,8 +347,8 @@ class Array: def __array_namespace__(self: Array, /, *, api_version: Optional[str] = None) -> object: if api_version is not None and not api_version.startswith('2021.'): raise ValueError(f"Unrecognized array API version: {api_version!r}") - from numpy import _array_api - return _array_api + from numpy import array_api + return array_api def __bool__(self: Array, /) -> bool: """ diff --git a/numpy/_array_api/_constants.py b/numpy/array_api/_constants.py index 9541941e7..9541941e7 100644 --- a/numpy/_array_api/_constants.py +++ b/numpy/array_api/_constants.py diff --git a/numpy/_array_api/_creation_functions.py b/numpy/array_api/_creation_functions.py index acf78056a..acf78056a 100644 --- a/numpy/_array_api/_creation_functions.py +++ b/numpy/array_api/_creation_functions.py diff --git a/numpy/_array_api/_data_type_functions.py b/numpy/array_api/_data_type_functions.py index 17a00cc6d..17a00cc6d 100644 --- a/numpy/_array_api/_data_type_functions.py +++ b/numpy/array_api/_data_type_functions.py diff --git a/numpy/_array_api/_dtypes.py b/numpy/array_api/_dtypes.py index fcdb562da..fcdb562da 100644 --- a/numpy/_array_api/_dtypes.py +++ b/numpy/array_api/_dtypes.py diff --git a/numpy/_array_api/_elementwise_functions.py b/numpy/array_api/_elementwise_functions.py index 7833ebe54..7833ebe54 100644 --- a/numpy/_array_api/_elementwise_functions.py +++ b/numpy/array_api/_elementwise_functions.py diff --git a/numpy/_array_api/_linear_algebra_functions.py b/numpy/array_api/_linear_algebra_functions.py index f13f9c541..f13f9c541 100644 --- a/numpy/_array_api/_linear_algebra_functions.py +++ b/numpy/array_api/_linear_algebra_functions.py diff --git a/numpy/_array_api/_manipulation_functions.py b/numpy/array_api/_manipulation_functions.py index fa6344beb..fa6344beb 100644 --- a/numpy/_array_api/_manipulation_functions.py +++ b/numpy/array_api/_manipulation_functions.py diff --git a/numpy/_array_api/_searching_functions.py b/numpy/array_api/_searching_functions.py index d80720850..d80720850 100644 --- a/numpy/_array_api/_searching_functions.py +++ b/numpy/array_api/_searching_functions.py diff --git a/numpy/_array_api/_set_functions.py b/numpy/array_api/_set_functions.py index f28c2ee72..f28c2ee72 100644 --- a/numpy/_array_api/_set_functions.py +++ b/numpy/array_api/_set_functions.py diff --git a/numpy/_array_api/_sorting_functions.py b/numpy/array_api/_sorting_functions.py index a125e0718..a125e0718 100644 --- a/numpy/_array_api/_sorting_functions.py +++ b/numpy/array_api/_sorting_functions.py diff --git a/numpy/_array_api/_statistical_functions.py b/numpy/array_api/_statistical_functions.py index 61fc60c46..61fc60c46 100644 --- a/numpy/_array_api/_statistical_functions.py +++ b/numpy/array_api/_statistical_functions.py diff --git a/numpy/_array_api/_typing.py b/numpy/array_api/_typing.py index 4ff718205..4ff718205 100644 --- a/numpy/_array_api/_typing.py +++ b/numpy/array_api/_typing.py diff --git a/numpy/_array_api/_utility_functions.py b/numpy/array_api/_utility_functions.py index f243bfe68..f243bfe68 100644 --- a/numpy/_array_api/_utility_functions.py +++ b/numpy/array_api/_utility_functions.py diff --git a/numpy/_array_api/tests/__init__.py b/numpy/array_api/tests/__init__.py index 536062e38..536062e38 100644 --- a/numpy/_array_api/tests/__init__.py +++ b/numpy/array_api/tests/__init__.py diff --git a/numpy/_array_api/tests/test_array_object.py b/numpy/array_api/tests/test_array_object.py index 22078bbee..22078bbee 100644 --- a/numpy/_array_api/tests/test_array_object.py +++ b/numpy/array_api/tests/test_array_object.py diff --git a/numpy/_array_api/tests/test_creation_functions.py b/numpy/array_api/tests/test_creation_functions.py index 654f1d9b3..654f1d9b3 100644 --- a/numpy/_array_api/tests/test_creation_functions.py +++ b/numpy/array_api/tests/test_creation_functions.py diff --git a/numpy/_array_api/tests/test_elementwise_functions.py b/numpy/array_api/tests/test_elementwise_functions.py index 994cb0bf0..994cb0bf0 100644 --- a/numpy/_array_api/tests/test_elementwise_functions.py +++ b/numpy/array_api/tests/test_elementwise_functions.py diff --git a/numpy/setup.py b/numpy/setup.py index 82c4c8d1b..a0ca99919 100644 --- a/numpy/setup.py +++ b/numpy/setup.py @@ -4,7 +4,7 @@ def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('numpy', parent_package, top_path) - config.add_subpackage('_array_api') + config.add_subpackage('array_api') config.add_subpackage('compat') config.add_subpackage('core') config.add_subpackage('distutils') |