diff options
| author | Ross Barnowski <rossbar@berkeley.edu> | 2022-09-19 13:50:48 -0700 |
|---|---|---|
| committer | Ross Barnowski <rossbar@berkeley.edu> | 2022-10-06 11:14:49 -0700 |
| commit | a2cc1c39307c70c073038d79e17346e962720024 (patch) | |
| tree | 39fed111823254dae3c27b5b76acec9fb5bafca4 /numpy/linalg | |
| parent | 65eb581a3bd4b5e0ee390606e20dc4b6f8597b34 (diff) | |
| download | numpy-a2cc1c39307c70c073038d79e17346e962720024.tar.gz | |
DEP: fastCopyAndTranspose and PyArray_CopyAndTranspose
Deprecate the fastCopyAndTranspose function from the Python API, and the
underlying PyArray_CopyAndTranspose function from the C-API.
Also removes an internal, private function _fastCopyAndTranspose which
was the original Python wrapper around the C-function.
Diffstat (limited to 'numpy/linalg')
| -rw-r--r-- | numpy/linalg/linalg.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index 6d7dda2b6..6f3400450 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -21,7 +21,7 @@ import warnings from numpy.core import ( array, asarray, zeros, empty, empty_like, intc, single, double, csingle, cdouble, inexact, complexfloating, newaxis, all, Inf, dot, - add, multiply, sqrt, fastCopyAndTranspose, sum, isfinite, + add, multiply, sqrt, sum, isfinite, finfo, errstate, geterrobj, moveaxis, amin, amax, product, abs, atleast_2d, intp, asanyarray, object_, matmul, swapaxes, divide, count_nonzero, isnan, sign, argsort, sort, @@ -158,10 +158,6 @@ def _commonType(*arrays): return t, result_type -# _fastCopyAndTranpose assumes the input is 2D (as all the calls in here are). - -_fastCT = fastCopyAndTranspose - def _to_native_byte_order(*arrays): ret = [] for arr in arrays: @@ -174,12 +170,13 @@ def _to_native_byte_order(*arrays): else: return ret + def _fastCopyAndTranspose(type, *arrays): cast_arrays = () for a in arrays: if a.dtype.type is not type: a = a.astype(type) - cast_arrays = cast_arrays + (_fastCT(a),) + cast_arrays = cast_arrays + (a.T.copy(),) if len(cast_arrays) == 1: return cast_arrays[0] else: @@ -1172,7 +1169,7 @@ def eigvalsh(a, UPLO='L'): def _convertarray(a): t, result_t = _commonType(a) - a = _fastCT(a.astype(t)) + a = a.astype(t).T.copy() return a, t, result_t |
