| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We have three choices:
1. Be compatible with limited API (oldest supported Python version)
2. Be compatible with everything on the same Python version (this)
3. Be strict and default to NEP 29
This just rephrases things to be 2. Because our API version was not
bumped over the relevant time frame, it is actually also compatible
with the first.
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The default compiles compatibly with 1.17.x, we allow going back to
1.15 (mainly because it is easy).
There were few additions in this time, a few structs grew and very
few API functions were added. Added a way to mark API functions
as requiring a specific target version.
If a user wishes to use the *new* API, they have to add the definition:
#define NPY_TARGET_VERSION NPY_1_22_API_VERSION
Before importing NumPy. (Our version numbering is a bit funny
I first thought to use a hex version of the main NumPy version,
but since we already have the `NPY_1_22_API_VERSION` defines...)
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This is a way for downstream users to specify which NumPy version
they wish to be compaible with.
Note that we provide a conservative default here (because almost nobody
actually uses new API as they would lose backwards compatibility).
Initially I had thought we should just redefine it so that the target
version uses the same scheme as the Python hex version (and limited API),
but since we have `NPY_1_15_API_VERSION` defines, use those...
This commit does not include any actual use of this!
|
| |\ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
ENH: Adding Object dtype to einsum
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Implementing Erics suggestions
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | | | | | | | | | |
|
| | |/ / / / / / / |
|
| |\ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
MAINT: remove redundant open() modes and io.open() alias
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
DEP,BUG: Finalize subarray dtype FutureWarning and fix its assignment
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
This unfortunately switches over the C-only path when FromArray
is called with a subarray dtype.
Together with the previous commit (which is very simple but in a sense
does the heavy lifting):
Closes gh-23083
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
This is now OK to just support, we won't replace things and things
should work out for the most part (probably).
|
| | | |_|/ / / / / /
| | |/| | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
In some cases we know that we want to use the *exact* dtype that we already
have (mainly when taking views). This is also useful internally because there
are very rare code-paths were we even create temporary arrays that contain
subarray dtypes.
|
| |\ \ \ \ \ \ \ \ \
| | |/ / / / / / / /
| |/| | | | | | | | |
API: Add DType classes into new `numpy.dtypes` module
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
DEP: Finalize checking for sequence-like if something is array-like
|
| | | |_|_|_|_|_|/ /
| | |/| | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This was always just a stop-gap for shapely basically, so there is
no harm finalizing things.
|
| |/ / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This takes the [sin](https://github.com/ARM-software/optimized-routines/blob/master/math/v_sin.c) and [cos](https://github.com/ARM-software/optimized-routines/blob/master/math/v_cos.c) algorithms from Optimized Routines under MIT license, and converts them to Numpy intrinsics.
The routines are within the ULP boundaries of other vectorised math routines (<4ULP). The routines reduce performance in some special cases but improves normal cases. Comparing to the SVML implementation, these routines are more performant in special cases, we're therefore safe to assume the performance is acceptable for AArch64 as well.
| performance ratio (lower is better) | benchmark |
| ---- | ---- |
| 1.8 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 2 'd') |
| 1.79 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 4 'd') |
| 1.77 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 4 1 'd') |
| 1.74 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 2 'd') |
| 1.74 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 4 'd') |
| 1.72 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 2 1 'd') |
| 1.6 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 2 'd') |
| 1.6 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 4 'd') |
| 1.56 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'cos'> 1 1 'd') |
| 1.42 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 2 'd') |
| 1.41 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 4 'd') |
| 1.37 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 2 1 'd') |
| 1.26 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 2 'd') |
| 1.26 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 4 'd') |
| 1.2 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 4 1 'd') |
| 1.18 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 2 'd') |
| 1.18 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 4 'd') |
| 1.12 | bench_ufunc_strides.UnaryFPSpecial.time_unary(<ufunc 'sin'> 1 1 'd') |
| 0.65 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 2 'd') |
| 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 4 'd') |
| 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 4 'd') |
| 0.64 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 2 'd') |
| 0.61 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 4 'd') |
| 0.61 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 2 'd') |
| 0.6 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 2 1 'd') |
| 0.6 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 4 1 'd') |
| 0.56 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'cos'> 1 1 'd') |
| 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 2 'd') |
| 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 4 'd') |
| 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 4 'd') |
| 0.52 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 2 'd') |
| 0.47 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 4 'd') |
| 0.47 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 2 'd') |
| 0.46 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 4 1 'd') |
| 0.46 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 2 1 'd') |
| 0.42 | bench_ufunc_strides.UnaryFP.time_unary(<ufunc 'sin'> 1 1 'd') |
Co-authored-by: Pierre Blanchard <Pierre.Blanchard@arm.com>
|
| |\ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
ENH: Extend the functionlty of C++ type `np::Half`
|
| | | |_|_|_|/ / /
| | |/| | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
- optimize float/double conversions on x86, requires for now
raising up the baseline features to `f16c` at least
during the build.
- optimize float/double conversions on ppc64le, requires for now
raising up the baseline features to `VSX3` at least
during the build.
- Brings `np::Half` to npymath
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
codepoints.
Closes #20118
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
In the "See also" section of [`sqrt` docstring](https://numpy.org/devdocs/reference/generated/numpy.sqrt.html#numpy.sqrt),
`Note: ...` is incorrectly parsed by numpydoc. So removed `:` to fix.
|
| | |_|_|_|_|/ /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This PR reflects some of the progress achieved in issue #10404 and is used to asses the impact of the changes.
With the changes in this PR, `float(numpy.array([1.0])` now gives a warning; likewise some other things:
```python
import numpy
a = numpy.random.rand(10, 1)
a[0] = numpy.array([1.0]) # okay
a[0] = numpy.array(1.0) # okay
a[0] = 1.0 # okay
b = numpy.random.rand(10)
b[0] = numpy.array([1.0]) # ValueError: setting an array element with a sequence.
b[0, ...] = numpy.array([1.0]) # okay
b[0] = numpy.array(1.0) # okay
b[0] = 1.0 # okay
```
This aligns the behavior of numpy arrays with that of lists:
```python
float([3.14])
```
```
TypeError: float() argument must be a string or a number, not 'list'
```
```python
import numpy as np
a = np.random.rand(5)
a[0] = [3.14]
```
```
ValueError: setting an array element with a sequence.
```
Fixes #10404.
|
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
ENH: refactor zero-filling and expose dtype API slot for it
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| |\ \ \ \ \ \ \ \
| | |/ / / / / / /
| |/| | | | | | | |
ENH: Use threshold also inside SubArrayFormat.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Previously, for structured arrays that contain a lot of elements,
those are always all shown, independent of the threshold print option.
This PR ensures that threshold and edgeitems are respected.
Note that multidimensional items are typeset without line breaks,
to avoid breaking up the structure. Hence, this does not solve the
issue that structured array elements can easily overfill a line on
the console.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This gets rid of undefined symbol issues for `assert`.
Closes gh-23122
Closes gh-23595
|