From f531110689a646f574ad1529d78b6047cf397f3e Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sat, 5 Dec 2020 22:38:47 -0600 Subject: ENH: Use new argument parsing for array creation functions The array creation functions have the most to gain: 1. np.asarray is 4 times faster and commonly used. 2. Other functions are wrapped using __array_function__ in Python making it more difficult This commit (unfortunatly) has to do a few things: * Modify __array_function__ C-side dispatching to accomodate the fastcall argument convention. * Move asarray, etc. to C after removing all "fast paths" from np.array (simplifying the code) * Fixup imports, since asarray was imported directly in a few places * Replace some places where `np.array` was probably used for speed instead of np.asarray or similar. (or by accident in 1 or 2 places) --- numpy/core/shape_base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/core/shape_base.py') diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index 89e98ab30..a81a04f7f 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -8,8 +8,7 @@ import warnings from . import numeric as _nx from . import overrides -from ._asarray import array, asanyarray -from .multiarray import normalize_axis_index +from .multiarray import array, asanyarray, normalize_axis_index from . import fromnumeric as _from_nx -- cgit v1.2.1