| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
BUG: don't silence __array_wrap__ errors in ufunc.reduce
|
| |
| |
| |
| |
| |
| | |
not needed
The functions themselves have not changed, only moved
|
| |
| |
| |
| |
| |
| | |
in ufunc.__call__
Previously they were silenced
|
| | |
|
| |
| |
| |
| |
| |
| | |
For regular arrays, we now give a deprecation warning if
np.positive cannot handle it; for ndarray subclasses that override
__array_ufunc__, we pass on the type error.
|
|\ \
| | |
| | | |
BUG: Make np.array([[1], 2]) and np.array([1, [2]]) behave in the same way
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Also tidy line-wrapping
|
| | | |
|
| | |
| | |
| | | |
BLD: Modify cpu detection and printing to get working aarch64 build
|
| | |
| | |
| | |
| | |
| | |
| | | |
* DOC: Updated array2string description
* DOC: Updated array2string description
|
|\ \ \
| | | |
| | | | |
DEP: deprecate undocumented, unused dtype type dicts
|
| | | | |
|
| | | | |
|
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | | |
MAINT: Speed up normalize_axis_tuple by about 30%
|
| | | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is used in `np.moveaxis`, which is relatively slow.
Timings change as follows:
```
import numpy as np
from numpy.core.numeric import normalize_axis_tuple
%timeit normalize_axis_tuple([0, 1, 2], 4, 'parrot')
a = np.zeros((10,20,30))
%timeit np.moveaxis(a, [0,1,2], [2,1,0])
100000 loops, best of 3: 5.56 µs per loop -> 4.17 µs
```
|
|\ \ \
| | | |
| | | | |
DOC: Include warning in np.resize() docs
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
removed 'simple'
altered sentence describing which items are taken from `old` into `new`
therefor -> therefore
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I find it counterintuitive that resizing a numpy array does NOT consider dimensions independent, but simply takes the first N elements of the input array that fit into the output array. I was expecting something more like `cv2.resize()` where axes are treated separately, and some form of interpolation is applied to each dimension.
numpy resizes an old 5x5x2 array into a new array with new = np.resize(old, (4, 4, 2)) by simply copying the first 4 * 4 * 2 entries from old into new. (e.g. old[0, 4, :] becomes new[1, 0, :])
This is a problem if we would like simple interpolation, or if different axes represent different entities. (If the above example is an image, the top right most pixel would get warped all the way to the left, which is most likely not the intention)
In response to my issue #11478: 'resize() is unintuitive by not treating axes separately?'
A warning in the docs might prevent some confusion.
For a discussion on the issue and a possible solution, see <https://github.com/numpy/numpy/issues/11478>
|
|\ \ \ \
| | | | |
| | | | | |
BUG: Don't convert inputs to `np.float64` in digitize
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This converts digitize to a pure-python function that falls back on searchsorted.
Performance doesn't really matter here anyway - if you care about performance, then you should just call searchsorted directly, rather than checking the order of the bins.
Partially fixes gh-11022
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
BUG: Fix #define for ppc64 and ppc64le
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The current logic for defining NPY_CPU_PPC64LE and NPY_CPU_PPC64 is
incorrect for two reasons:
1) The elif defined for __powerpc__ is proceesed first so any
ppc64le or ppc64 system is defined as NPY_CPU_PPC.
2) __ppc64le__ is not defined on a ppc64le system. __PPC64__ is
defined and so is __powerpc64__ but the check for little or
big endian needs to be done seperately.
This pull request fixes the defines for ppc64le and ppc64.
Note: This really isn't a issue in the numpy code base at this time
because the only place this variable is referenced is in npy_endian.h
as a fallback in case endian.h is not on the system.
It would be good to fix in case future code does reference
these defines.
|
|\ \ \ \
| | | | |
| | | | | |
ENH: Add AARCH32 support.
|
| | | | |
| | | | |
| | | | |
| | | | | |
As title.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This adds support for identifying AARCH32 and AARCH64 at compile
time such that alignment etc is correctly determined.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* Minor tweaks to the optimal path based on opt_einsum
* Updates greedy path to current opt_einsum tech
* Reworks einsum broadcasting vs dot tech and can_dot logic
* MAINT: Fix typo in comment.
* BUG: Fix bad merge fixup.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
BUG: Advanced indexing assignment incorrectly took 1-D fastpath
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When the index array was non contiguous and not 1D the assignment
1D fastpath (indexed array being 1D) was incorrectly taken (also
the assignment value had to be 0D for this to happen).
This caused the iteration to use the itemsize as a stride, since
it incorrectly assumed the array must be contiguous.
The commit additionally adds an assert to the STRIDE fetching macro.
Closes gh-11467.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
MAINT: Move add_newdocs into core, since it only adds docs to those pieces
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
| | | | | | |
MAINT: Move pytesttester outside of np.testing, to avoid creating unnecessary import dependencies
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
unnecessary import dependencies
pytesttester is used by every single subpackage, so making it depend on np.testing just creates cyclic dependencies that can lead to circular imports
Relates to #11457
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
MAINT: Improve speed of ufunc kwargs parsing
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Using the realization from inspecting similar CPython code that as we
intern string names anyway, comparing keys with possible names by
pointer will generally just work.
Also rather drastically rewrote, to use a new parser with simple
conversion functions to replace part of the enormous switch/case
structure, process out separately, and check for duplication after the
parsing.
Reduces the overhead as follows:
```
import numpy as np
a = np.array(1)
b = np.empty_like(a)
%timeit np.positive(a) # 352->348 ns
%timeit np.positive(a, subok=True) # 606->501 ns
%timeit np.positive(a, where=True) # 586->503 ns
%timeit np.positive(a, where=True, subok=True) # 695->531 ns
%timeit np.positive(a, b) # 354->352 ns
%timeit np.positive(a, out=b) # 557->480 ns
%timeit np.positive(a, out=b, subok=True) # 668->506 ns
%timeit np.positive(a, out=b, where=True, subok=True) # 752->536 ns
```
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
DOC: Fix documentation for fromfunction
|
| | | | | |
| | | | | |
| | | | | | |
```np.fromfunction(lambda i, j: 1, (3, 3), dtype=int)``` returns ```1```.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
MAINT: Refactor differences between cblas_matrixproduct and PyArray_MatrixProduct2
|
| | |_|/ / /
| |/| | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
BUG: fix interpolation with inf and NaN present
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Values like NaN and inf would result in wrong interpolated values on
exactly matching sampling points. To produce the correct behavior, we
add an additional check to avoid interpolation when handling such a
point.
Closes #11439
|
|\ \ \ \ \
| | | | | |
| | | | | | |
BUG: ensure ret is out in einsum
|
| | | | | | |
|