summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | BUG: Changed METH_VARARGS to METH_NOARGSmrios2021-03-251-0/+4
| | | | | |
| * | | | | BUG: Changed METH_VARARGS to METH_NOARGSmrios2021-03-251-1/+1
| | | | | |
* | | | | | Merge pull request #18515 from terfilip/select-dtype-err-msg-18430Charles Harris2021-03-261-2/+13
|\ \ \ \ \ \ | |/ / / / / |/| | | | | MAINT: Improve error message when common type not found.
| * | | | | MAINT: Adding exception chaining and switching to fstringFilip Ter2021-03-241-5/+4
| | | | | |
| * | | | | ENH: A more helpful error message, when types don't match type of default kwargFilip Ter2021-02-281-2/+14
| | | | | |
* | | | | | Merge pull request #15271 from seberg/splitup-faster-argparsingCharles Harris2021-03-248-1177/+898
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH: Optimize and cleanup ufunc calls and ufunc CheckOverrides
| * | | | | | BUG: Fix bug(s) introduced due to rebase/merge conflictSebastian Berg2021-03-231-2/+1
| | | | | | |
| * | | | | | DOC: Fixup ufunc-argparse release notes and code commentsSebastian Berg2021-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on Marten's review again.
| * | | | | | MAINT: Declare functions `static` rather than `NPY_NO_EXPORT`Sebastian Berg2021-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions do not require `NPY_NO_EXPORT`. One of them was (incorrectly) flagged by code coverage. Maybe this helps...
| * | | | | | BUG: Add missing `static` leading to a (harmless) ref-leakSebastian Berg2021-03-231-1/+1
| | | | | | |
| * | | | | | BUG: Add missing decref to `dtype` parsingSebastian Berg2021-03-231-0/+1
| | | | | | |
| * | | | | | MAINT: Address comments by MartenSebastian Berg2021-03-235-94/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | DOC: Fixup comment style for nowSebastian Berg2021-03-231-1/+1
| | | | | | |
| * | | | | | DOC: Fixup comments based on review and remove TODOSebastian Berg2021-03-233-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | | | | | ENH: Optimize and cleanup ufunc calls and ufunc CheckOverridesSebastian Berg2021-03-239-1155/+883
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Improve performance of `np.save` for small arrays (gh-18657)Ohad Ravid2021-03-241-6/+10
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | | | | Merge pull request #18670 from seberg/small-pytest-leaks-fixesCharles Harris2021-03-236-24/+37
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | BUG: Fix small issues found with pytest-leaks
| * | | | | BUG: Fix small issues found with pytest-leaksSebastian Berg2021-03-236-24/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | PERF: Use exponentials in place of inversionKevin Sheppard2021-03-225-10/+20
|/ / / / / | | | | | | | | | | | | | | | Use exponentials rather than generating exponentials via inversion
* | | | | Merge pull request #18652 from timhoffm/doc-plotRalf Gommers2021-03-212-4/+7
|\ \ \ \ \ | | | | | | | | | | | | DOC: Update some plotting code to current Matplotlib idioms
| * | | | | DOC: Update some plotting code to current Matplotlib idiomsTim Hoffmann2021-03-212-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | | | | BLD: remove /usr/include from default include dirsRalf Gommers2021-03-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | | | Merge pull request #18579 from mwtoews/refactor-dictRalf Gommers2021-03-213-42/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | MAINT: OrderedDict is no longer necessary from Python 3.7
| * | | | | | MAINT: OrderedDict is no longer necessary from Python 3.7Mike Taves2021-03-083-42/+15
| | | | | | |
* | | | | | | Merge pull request #18593 from seberg/stop-lying-about-binop-inputsMatti Picus2021-03-217-54/+68
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | MAINT: Do not claim input to binops is `self` (array object)
| * | | | | | | TST: Add minimal test for passing an out argument to arr.conjugate()Sebastian Berg2021-03-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can currently only be passed positionally, and this is undocumented.
| * | | | | | | Update numpy/core/src/multiarray/calculation.cSebastian Berg2021-03-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
| * | | | | | | MAINT: Do not claim input to binops is `self` (array object)Sebastian Berg2021-03-106-54/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | Merge pull request #18642 from seberg/splitup-faster-argparsing-optimize-asarrayMatti Picus2021-03-2119-545/+694
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | ENH: Use new argument parsing for array creation functions
| * | | | | | | | DOC: Update the docs to match how they changed in masterSebastian Berg2021-03-181-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had forgotten that the docs for these functions where updated when rebasing.
| * | | | | | | | BUG,TST: Fix error path and argument name (and add test coverage)Sebastian Berg2021-03-183-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...)
| * | | | | | | | DOC: Add TODO comment that `asarray` stubs will need movingSebastian Berg2021-03-181-0/+4
| | | | | | | | |
| * | | | | | | | BUG: import `asanyarray` to `_asarray.py` as its used in `np.require`Sebastian Berg2021-03-181-1/+1
| | | | | | | | |
| * | | | | | | | ENH: Use new argument parsing for array creation functionsSebastian Berg2021-03-1817-544/+629
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | | | | | | Merge pull request #18648 from mwtoews/pep-3135Sebastian Berg2021-03-2016-59/+56
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | | MAINT: use super() as described by PEP 3135
| * | | | | | | MAINT: use super() as described by PEP 3135Mike Taves2021-03-1916-59/+56
| | | | | | | |
* | | | | | | | BUG: Fix small valgrind-found issues (#18651)Sebastian Berg2021-03-195-1/+6
| |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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...
* | | | | | | MAINT: Add mising type to cdef statementKevin Sheppard2021-03-193-4/+4
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Add missing type to cdef statement Small spelling fix
* | | | | | MAINT: Added Chain exceptions where appropriate (#18400)Abhay Raghuvanshi2021-03-183-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | | | | | Merge pull request #17492 from aitikgupta/unwanted-mode-depMatti Picus2021-03-186-20/+120
|\ \ \ \ \ \ | |/ / / / / |/| | | | | DEP: Shift correlate mode parsing to C and deprecate inexact matches
| * | | | | A few whitespace cleanupsAitik Gupta2021-03-181-5/+6
| | | | | |
| * | | | | The same test for np.correlateAitik Gupta2021-03-181-0/+5
| | | | | |
| * | | | | Add one more test for illegal argumentsAitik Gupta2021-03-181-0/+3
| | | | | | | | | | | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | | | | Update numpy/core/src/multiarray/conversion_utils.cEric Wieser2021-03-181-0/+1
| | | | | |
| * | | | | TST: Added test for inexact matches of modeAitik Gupta2021-03-181-0/+23
| | | | | |
| * | | | | DEP: Deprecate inexact matches of mode, shift parameter parsing to CAitik Gupta2021-03-185-15/+82
| | | | | |
* | | | | | MAINT: Added Chain exceptions where appropriate (#18394)Abhay Raghuvanshi2021-03-187-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | | | | | Merge pull request #18398 from seberg/casting-loop-signatureMatti Picus2021-03-1823-2255/+1765
|\ \ \ \ \ \ | |/ / / / / |/| | | | | MAINT: Fix casting signatures to align with NEP 43 signature
| * | | | | MAINT: Add comment to unused func, silence linter and avoid non-contig errorSebastian Berg2021-03-183-12/+18
| | | | | |
| * | | | | TST: Expend write-mask buffered nditer tests for high dim arraysSebastian Berg2021-03-171-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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?