diff options
author | Stephan Hoyer <shoyer@google.com> | 2019-05-26 12:04:44 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2019-05-26 12:04:44 -0700 |
commit | 9216a1dd5391013bf0670bb3d9d07ef68c3b7d66 (patch) | |
tree | 99924c389973ffe0792f08cbd93730c5d10dd4fc /numpy/core/shape_base.py | |
parent | 37df5e641f19d9e5221cb519532b6cc5647ebe53 (diff) | |
download | numpy-9216a1dd5391013bf0670bb3d9d07ef68c3b7d66.tar.gz |
MAINT: Fixes tests with __array_function__ disabled
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r-- | numpy/core/shape_base.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index 3a037e7d2..45115adb6 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -273,6 +273,9 @@ def vstack(tup): [4]]) """ + if not overrides.ARRAY_FUNCTION_ENABLED: + # raise warning if necessary + _arrays_for_stack_dispatcher(tup, stacklevel=2) return _nx.concatenate([atleast_2d(_m) for _m in tup], 0) @@ -324,6 +327,10 @@ def hstack(tup): [3, 4]]) """ + if not overrides.ARRAY_FUNCTION_ENABLED: + # raise warning if necessary + _arrays_for_stack_dispatcher(tup, stacklevel=2) + arrs = [atleast_1d(_m) for _m in tup] # As a special case, dimension 0 of 1-dimensional arrays is "horizontal" if arrs and arrs[0].ndim == 1: @@ -400,6 +407,10 @@ def stack(arrays, axis=0, out=None): [3, 4]]) """ + if not overrides.ARRAY_FUNCTION_ENABLED: + # raise warning if necessary + _arrays_for_stack_dispatcher(arrays, stacklevel=2) + arrays = [asanyarray(arr) for arr in arrays] if not arrays: raise ValueError('need at least one array to stack') |