From 96d179ce5bd0e3f75508f6afdfb2fb65170cc83c Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Tue, 22 Jan 2019 14:07:47 -0800 Subject: ENH: __array_function__ updates for NumPy 1.17.0 - Always enable __array_function__ overrides. - Remove special cases for Python 2 compatibility. - Document these changes in 1.17.0-notes.rst. It will be good to see ASV numbers to understand the performance implications of these changes. If need be, we can speed up NumPy functions internally by using non-dispatched functions (with ``.__wrapped__``). --- numpy/core/shape_base.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'numpy/core/shape_base.py') diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index f8332c362..08e07bb66 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -217,11 +217,6 @@ 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) @@ -279,7 +274,6 @@ def vstack(tup): [4]]) """ - _warn_for_nonsequence(tup) return _nx.concatenate([atleast_2d(_m) for _m in tup], 0) @@ -331,7 +325,6 @@ 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: @@ -406,7 +399,6 @@ 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') -- cgit v1.2.1