diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-07-08 17:22:47 -0600 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-07-08 17:22:47 -0600 |
commit | aee3a56d4e150a55c590966c9cc2ae0e201fa936 (patch) | |
tree | cb2519e418f8e7b0ad850c5e8c094a801472d9ef /numpy/_array_api/_utility_functions.py | |
parent | fc1ff6fc3045482a72c359689ee7bfa7e3299985 (diff) | |
download | numpy-aee3a56d4e150a55c590966c9cc2ae0e201fa936.tar.gz |
Rename the array class in the array API namespace from ndarray to Array
The actual class name doesn't matter because it isn't part of the namespace
API (arrays should be constructed with the array creation functions like
asarray()). However, it is better to use a name that is different from the
existing NumPy array object to avoid ambiguity.
Diffstat (limited to 'numpy/_array_api/_utility_functions.py')
-rw-r--r-- | numpy/_array_api/_utility_functions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/_array_api/_utility_functions.py b/numpy/_array_api/_utility_functions.py index a6a7721dd..ba77d3668 100644 --- a/numpy/_array_api/_utility_functions.py +++ b/numpy/_array_api/_utility_functions.py @@ -1,10 +1,10 @@ from __future__ import annotations -from ._array_object import ndarray +from ._array_object import Array from typing import TYPE_CHECKING if TYPE_CHECKING: - from ._types import Optional, Tuple, Union, Array + from ._types import Optional, Tuple, Union import numpy as np @@ -14,7 +14,7 @@ def all(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep See its docstring for more information. """ - return ndarray._new(np.asarray(np.all(x._array, axis=axis, keepdims=keepdims))) + return Array._new(np.asarray(np.all(x._array, axis=axis, keepdims=keepdims))) def any(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False) -> Array: """ @@ -22,4 +22,4 @@ def any(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep See its docstring for more information. """ - return ndarray._new(np.asarray(np.any(x._array, axis=axis, keepdims=keepdims))) + return Array._new(np.asarray(np.any(x._array, axis=axis, keepdims=keepdims))) |