diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-01-12 12:34:59 -0700 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-01-12 12:34:59 -0700 |
commit | 9578636259f86267c2253f4af2510ce1eeaf084c (patch) | |
tree | f140af373c657aa2d3d107dd6504910bc5a47702 | |
parent | d9651020aa9e1f6211b920954a357ac45712938d (diff) | |
download | numpy-9578636259f86267c2253f4af2510ce1eeaf084c.tar.gz |
Make the array_api submodules private, and remove __all__ from individual files
The specific submodule organization is an implementation detail and should not
be used. Only the top-level numpy._array_api namespace should be used.
-rw-r--r-- | numpy/_array_api/_constants.py | 1 | ||||
-rw-r--r-- | numpy/_array_api/_creation_functions.py (renamed from numpy/_array_api/creation_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_dtypes.py (renamed from numpy/_array_api/dtypes.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_elementwise_functions.py (renamed from numpy/_array_api/elementwise_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_linear_algebra_functions.py (renamed from numpy/_array_api/linear_algebra_functions.py) | 4 | ||||
-rw-r--r-- | numpy/_array_api/_manipulation_functions.py (renamed from numpy/_array_api/manipulation_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_searching_functions.py (renamed from numpy/_array_api/searching_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_set_functions.py (renamed from numpy/_array_api/set_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_sorting_functions.py (renamed from numpy/_array_api/sorting_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_statistical_functions.py (renamed from numpy/_array_api/statistical_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/_utility_functions.py (renamed from numpy/_array_api/utility_functions.py) | 2 | ||||
-rw-r--r-- | numpy/_array_api/constants.py | 3 |
12 files changed, 1 insertions, 25 deletions
diff --git a/numpy/_array_api/_constants.py b/numpy/_array_api/_constants.py new file mode 100644 index 000000000..075b8c3b9 --- /dev/null +++ b/numpy/_array_api/_constants.py @@ -0,0 +1 @@ +from .. import e, inf, nan, pi diff --git a/numpy/_array_api/creation_functions.py b/numpy/_array_api/_creation_functions.py index ee3466d2f..4e91aa443 100644 --- a/numpy/_array_api/creation_functions.py +++ b/numpy/_array_api/_creation_functions.py @@ -74,5 +74,3 @@ def zeros_like(x, /, *, dtype=None, device=None): # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") return zeros_like(x, dtype=dtype) - -__all__ = ['arange', 'empty', 'empty_like', 'eye', 'full', 'full_like', 'linspace', 'ones', 'ones_like', 'zeros', 'zeros_like'] diff --git a/numpy/_array_api/dtypes.py b/numpy/_array_api/_dtypes.py index e94e70e9b..acf87fd82 100644 --- a/numpy/_array_api/dtypes.py +++ b/numpy/_array_api/_dtypes.py @@ -1,5 +1,3 @@ from .. import int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64 # Note: This name is changed from .. import bool_ as bool - -__all__ = ['int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'float32', 'float64', 'bool'] diff --git a/numpy/_array_api/elementwise_functions.py b/numpy/_array_api/_elementwise_functions.py index bacb733d9..f9052020e 100644 --- a/numpy/_array_api/elementwise_functions.py +++ b/numpy/_array_api/_elementwise_functions.py @@ -228,5 +228,3 @@ def tanh(x, /): def trunc(x, /): from .. import trunc return trunc(x) - -__all__ = ['abs', 'acos', 'acosh', 'add', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'bitwise_and', 'bitwise_left_shift', 'bitwise_invert', 'bitwise_or', 'bitwise_right_shift', 'bitwise_xor', 'ceil', 'cos', 'cosh', 'divide', 'equal', 'exp', 'expm1', 'floor', 'floor_divide', 'greater', 'greater_equal', 'isfinite', 'isinf', 'isnan', 'less', 'less_equal', 'log', 'log1p', 'log2', 'log10', 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'multiply', 'negative', 'not_equal', 'positive', 'pow', 'remainder', 'round', 'sign', 'sin', 'sinh', 'square', 'sqrt', 'subtract', 'tan', 'tanh', 'trunc'] diff --git a/numpy/_array_api/linear_algebra_functions.py b/numpy/_array_api/_linear_algebra_functions.py index 820dfffba..10c81d12c 100644 --- a/numpy/_array_api/linear_algebra_functions.py +++ b/numpy/_array_api/_linear_algebra_functions.py @@ -91,7 +91,3 @@ def trace(x, /, *, axis1=0, axis2=1, offset=0): def transpose(x, /, *, axes=None): from .. import transpose return transpose(x, axes=axes) - -# __all__ = ['cholesky', 'cross', 'det', 'diagonal', 'dot', 'eig', 'eigvalsh', 'einsum', 'inv', 'lstsq', 'matmul', 'matrix_power', 'matrix_rank', 'norm', 'outer', 'pinv', 'qr', 'slogdet', 'solve', 'svd', 'trace', 'transpose'] - -__all__ = ['cross', 'det', 'diagonal', 'inv', 'norm', 'outer', 'trace', 'transpose'] diff --git a/numpy/_array_api/manipulation_functions.py b/numpy/_array_api/_manipulation_functions.py index 80ca3381e..19e9c1cab 100644 --- a/numpy/_array_api/manipulation_functions.py +++ b/numpy/_array_api/_manipulation_functions.py @@ -26,5 +26,3 @@ def squeeze(x, /, *, axis=None): def stack(arrays, /, *, axis=0): from .. import stack return stack(arrays, axis=axis) - -__all__ = ['concat', 'expand_dims', 'flip', 'reshape', 'roll', 'squeeze', 'stack'] diff --git a/numpy/_array_api/searching_functions.py b/numpy/_array_api/_searching_functions.py index c4b6c58b5..c6035ca77 100644 --- a/numpy/_array_api/searching_functions.py +++ b/numpy/_array_api/_searching_functions.py @@ -13,5 +13,3 @@ def nonzero(x, /): def where(condition, x1, x2, /): from .. import where return where(condition, x1, x2) - -__all__ = ['argmax', 'argmin', 'nonzero', 'where'] diff --git a/numpy/_array_api/set_functions.py b/numpy/_array_api/_set_functions.py index f218f1187..b6198765a 100644 --- a/numpy/_array_api/set_functions.py +++ b/numpy/_array_api/_set_functions.py @@ -1,5 +1,3 @@ def unique(x, /, *, return_counts=False, return_index=False, return_inverse=False, sorted=True): from .. import unique return unique(x, return_counts=return_counts, return_index=return_index, return_inverse=return_inverse, sorted=sorted) - -__all__ = ['unique'] diff --git a/numpy/_array_api/sorting_functions.py b/numpy/_array_api/_sorting_functions.py index b75387737..98db3c7a2 100644 --- a/numpy/_array_api/sorting_functions.py +++ b/numpy/_array_api/_sorting_functions.py @@ -15,5 +15,3 @@ def sort(x, /, *, axis=-1, descending=False, stable=True): res = sort(x, axis=axis, kind=kind) if descending: res = flip(res, axis=axis) - -__all__ = ['argsort', 'sort'] diff --git a/numpy/_array_api/statistical_functions.py b/numpy/_array_api/_statistical_functions.py index b9180a863..339835095 100644 --- a/numpy/_array_api/statistical_functions.py +++ b/numpy/_array_api/_statistical_functions.py @@ -27,5 +27,3 @@ def var(x, /, *, axis=None, correction=0.0, keepdims=False): from .. import var # Note: the keyword argument correction is different here return var(x, axis=axis, ddof=correction, keepdims=keepdims) - -__all__ = ['max', 'mean', 'min', 'prod', 'std', 'sum', 'var'] diff --git a/numpy/_array_api/utility_functions.py b/numpy/_array_api/_utility_functions.py index eac0d4eaa..accc43e1e 100644 --- a/numpy/_array_api/utility_functions.py +++ b/numpy/_array_api/_utility_functions.py @@ -5,5 +5,3 @@ def all(x, /, *, axis=None, keepdims=False): def any(x, /, *, axis=None, keepdims=False): from .. import any return any(x, axis=axis, keepdims=keepdims) - -__all__ = ['all', 'any'] diff --git a/numpy/_array_api/constants.py b/numpy/_array_api/constants.py deleted file mode 100644 index 000777029..000000000 --- a/numpy/_array_api/constants.py +++ /dev/null @@ -1,3 +0,0 @@ -from .. import e, inf, nan, pi - -__all__ = ['e', 'inf', 'nan', 'pi'] |