diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-12-05 22:38:47 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-03-18 15:37:20 -0500 |
commit | f531110689a646f574ad1529d78b6047cf397f3e (patch) | |
tree | 4d5b1114309098fcda080557f2fd32ad1bbcdf08 /numpy/core/fromnumeric.py | |
parent | 9c68c2f7b1b2128a3b4af2134565f60d286fa8b9 (diff) | |
download | numpy-f531110689a646f574ad1529d78b6047cf397f3e.tar.gz |
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)
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index bb736d1a0..3646b39b0 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -10,8 +10,7 @@ from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt -from ._asarray import asarray, array, asanyarray -from .multiarray import concatenate +from .multiarray import asarray, array, asanyarray, concatenate from . import _methods _dt_ = nt.sctype2char |