From 9216a1dd5391013bf0670bb3d9d07ef68c3b7d66 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sun, 26 May 2019 12:04:44 -0700 Subject: MAINT: Fixes tests with __array_function__ disabled --- numpy/core/shape_base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'numpy/core/shape_base.py') 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') -- cgit v1.2.1