| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
MAINT: Improve error message when common type not found.
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
ENH: Optimize and cleanup ufunc calls and ufunc CheckOverrides
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is based on Marten's review again.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
These functions do not require `NPY_NO_EXPORT`. One of them was
(incorrectly) flagged by code coverage. Maybe this helps...
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This fixes the review comments by Marten, mainly small cleanups.
The largest change is that it is now back to a ValueError if the
out tuple has the wrong length.
Co-Authored-By: Marten van Kerkwijk <mhvk@astro.utoronto.ca>
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The TypeError TODO is also reflected in the tests I think, the
other TODO seems pretty unnecessary (most users will go through
`tp_vectorcall` anyway, so micro-optimizing that is not all that
relevant).
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is a rather large commit which clean up the ufunc override
code for argument parsing. (I may attempt to split it up)
There are two main things, argument parsing, especially for
reductions is now much faster since `METH_FASTCALL` is used
(when keyword arguments are being used).
By moving the argument parsing and using more generic code this
also simplifies the ufunc override checking especially when
keyword arguments are present.
Both of this decreases the argument parsing overhead quite a lot
for ufunc calls, especially for small reductions. (Without double
checking, I believe the speedup was up to around 30% for small
reductions.)
The downside is some added/annoyance due to the use of marcos to
support both FASTCALL and no FASTCALL semantics.
As a side note: vectorcall is likely not a huge factor for ufuncs
since it is very common not to use any keyword arguments. OTOH,
code that uses ``out=...`` a lot on small arrays should see a nice
difference.
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* ENH: Remove call to `_filter_header` from `_write_array_header`
Improve performance of `np.save` by removing the call
when writing the header, as it is known to be done in Python 3.
* ENH: Only call `_filter_header` from `_read_array_header` for old vers
Improve performance of `np.load` for arrays with version >= (3,0)
by removing the call, as it is known to be done in Python 3.
* ENH: Use a set of keys when checking `read_array`
Improve performance of `np.load`.
* DOC: Improve performance of `np.{save,load}` for small arrays
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
BUG: Fix small issues found with pytest-leaks
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
None of these are particularly worrying as they either usually only
leak reference (and not memory) or appear in rare or almost impossible
error-paths, or are limited to the tests.
Unfortunately, this PR will not apply to 1.20.x, due to small changes
in the overrides.
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
Use exponentials rather than generating exponentials via inversion
|
|\ \ \ \ \
| | | | | |
| | | | | | |
DOC: Update some plotting code to current Matplotlib idioms
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- 3D Axes are created via add_subplot(projection='3d')
- There is now a `stairs()` function that's specifically designed for
showing histogram curves
- Labels should be passed as keyword arguments to the plot functions
instead of to `legend()`, which reduces the risk of mixing them up.
- ensure equal axis scaling in the meshgrid example
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Including this directory is painful for cross-compiling, see
gh-14980 and gh-13280. Removing this directory fixes the following
build failure:
```
gcc: numpy/core/src/common/numpyos.c
In file included from numpy/core/src/common/numpyos.c:23:
/usr/include/xlocale.h:27:16: error: redefinition of ‘struct __locale_struct’
27 | typedef struct __locale_struct
```
This error also shows up in various other build issues outside of the
NumPy issue tracker.
Compilers normally always include this path, so this shouldn't break
anything. The default include paths for the compiler can be checked,
e.g. for gcc with `cpp -v`. That will typically have /usr/include last.
In case this breaks something for a nonstandard compiler, that can be
worked around via a site.cfg file in the root of the repo (or
equivalently, `~/numpy-site.cfg`) containing:
```
[DEFAULT]
include_dirs = /usr/include
```
The same principle should apply to `/usr/lib`. I will make that change
in a separate commit, because the failure mode for that will be
different (and I'm not running into it right now).
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
MAINT: OrderedDict is no longer necessary from Python 3.7
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
MAINT: Do not claim input to binops is `self` (array object)
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This can currently only be passed positionally, and this is
undocumented.
|
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
On the C-side binops only guarantee that one of the operands
is an instance of `PyArrayObject *`, but we do not know which
one. Typing the first as `PyArrayObject *` is just misleading
for almost no actual payoff
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
ENH: Use new argument parsing for array creation functions
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
I had forgotten that the docs for these functions where updated
when rebasing.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The argument name for the python side defined function was always
`a` and not `object` so fix it and add a test. Also add a test to
ensure the error paths are taken for all of the function.
The missing NULL returns cannot be tested easily (but thanks to
code coverage its nice to look at the uncovered stuff closer...)
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | |_|_|_|_|/ /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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)
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|_|_|/
|/| | | | | | | |
MAINT: use super() as described by PEP 3135
|
| | | | | | | | |
|
| |_|_|_|/ / /
|/| | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* BUG: Fix small valgrind-found issues
This should be backportable. There was at least one that I could
not reproduce when running the tests again. And the new random-shuffle
tests give false-positives (which is just slightly annoying, considering
that we are very close to almost only "longdouble" related
false-positives)
* BUG: Add missing decref in user-dtype fallback paths
The missing decref here only leaks references and can never leak
actual memory fortunately.
* MAINT,TST: Simplify the "refcount logic" in the dispatch tests again
Using SETREF can be nice, but was just overcomplicating thing here...
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add missing type to cdef statement
Small spelling fix
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* Added chain exception in _pocketfft.py
* Added chain exception in format.py
* Added chain exception in make_lite.py
* Added chain exception in mrecords.py
* added from e for exceptions
* Minor update for _read_array_header exception msg
* Removed \n from excp msg and e from msg format.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Update numpy/linalg/lapack_lite/make_lite.py
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
DEP: Shift correlate mode parsing to C and deprecate inexact matches
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | | |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* Added chain exception in _bits_of func
* Added chain exception
* Added chain exception in unixccompiler.py
* Added chain exception in config.py
* Added chain exception in fcompiler __init__.py
* Added chain exception in compaq.py
* Added chain exception in format.py
* Updated raise chain exception
* STY: Break long line.
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
MAINT: Fix casting signatures to align with NEP 43 signature
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is utterly confusing, but adds coverage to another uncovered
pass.
I honestly do not really understand right now, why "writemasked"
and "buffered" combination can bypass the buffering here.
I guess there some special logic about that in the `where=` ufunc
code that uses the masked versions here?
|