diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:12:18 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:12:18 -0800 |
commit | b44284ebc42c496e5c5d906acc33ebbc337fd3b1 (patch) | |
tree | 52322a497bc9c0def2065c48ce0c00e8eee750a3 /numpy/core/shape_base.py | |
parent | 56ce2327462eb9e3980c568ce9be628892aad89f (diff) | |
download | numpy-b44284ebc42c496e5c5d906acc33ebbc337fd3b1.tar.gz |
MAINT: more fixes for disabling overrides
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r-- | numpy/core/shape_base.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index 3edf0824e..6d234e527 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -217,6 +217,11 @@ def _arrays_for_stack_dispatcher(arrays, stacklevel=4): return arrays +def _warn_for_nonsequence(arrays): + if not overrides.ENABLE_ARRAY_FUNCTION: + _arrays_for_stack_dispatcher(arrays, stacklevel=4) + + def _vhstack_dispatcher(tup): return _arrays_for_stack_dispatcher(tup) @@ -274,6 +279,7 @@ def vstack(tup): [4]]) """ + _warn_for_nonsequence(tup) return _nx.concatenate([atleast_2d(_m) for _m in tup], 0) @@ -325,6 +331,7 @@ def hstack(tup): [3, 4]]) """ + _warn_for_nonsequence(tup) 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: @@ -398,6 +405,7 @@ def stack(arrays, axis=0, out=None): [3, 4]]) """ + _warn_for_nonsequence(arrays) arrays = [asanyarray(arr) for arr in arrays] if not arrays: raise ValueError('need at least one array to stack') |