| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
cross-platform code to find home folder when looking .numpy-site.cfg
|
| |
| |
| |
| | |
https://github.com/numpy/numpy/issues/3995
|
| |
| |
| |
| | |
Closes gh-4024
|
|/
|
|
|
|
|
| |
Previously the buffer was interpreted as 1-dimensional when
no shape was provided, even when ndim was 0.
Closes gh-4015
|
|\
| |
| | |
ENH: avoid expensive clears in fenv functions
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Clearing is 50-100 times more expensive than checking on x86, so check if there
is anything needs to be cleared first. This speeds up scalar operations
by 10%-20%.
Based on Arink Verma code in #3739.
Implement the functions as new C-API functions npy_get_floatstatus and
npy_clear_floatstatus in npy_math.
|
| | |
|
| | |
|
| |
| |
| |
| | |
avoids unnecessary creation of unused error objects.
|
| | |
|
| |
| |
| |
| | |
and tests/test_twodim_base.py. Also make a couple more PEP8 tweaks.
|
| |
| |
| |
| | |
more PEP8 tweaks.
|
| | |
|
| |
| |
| |
| | |
order of the powers (either decreasing or increasing).
|
| | |
|
|\ \
| | |
| | | |
BUG: hypot(inf, 0) shouldn't raise a warning
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
On any platform where we used our own implementation of hypot, (e.g.
windows) there were several issues with infs.
hypot(inf, y) == inf, for all y including nan. We now check for inf and
handle this case explicitly for all y instead of just y = nan.
Although hypot(inf, 0) was correctly returning inf, it was incorrectly
raising the invalid floating point exception.
Fixes gh-2385
|
| | |
| | |
| | |
| | |
| | |
| | | |
Do not convert the UPLO argument to a bytestring, it is not necessary.
Distribute parts of the eigh tests into the appropriate TestEigvalsh or
TestEigh test class.
|
|\ \ \
| | | |
| | | | |
BUG: fix broken UPLO of eigh in python3
|
| | | |
| | | |
| | | |
| | | | |
to prevent unintentional use of wrong function. Restores 1.7 behavior.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
UPLO was cast to bytes and compared to a string which is always false in
python3.
closes gh-3977
|
|\ \ \ \
| |/ / /
|/| | | |
BUG: fix handling of negative strides in npy_memchr
|
| | | |
| | | |
| | | |
| | | |
| | | | |
its only actually faster than just running through the trailing bytewise
loop if the needle is in the last byte.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
the new code did not account for them at all, add the old loops back but
keep the stride 1 optimization for sparse masks.
|
|\ \ \ \
| |_|_|/
|/| | | |
MAINT: Initialize strides in NpyIter and silence valgrind
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also changes some tests to not use np.empty as to avoid
valgrind spam.
The NpyIter strides are arbitrary, but 0 makes sense, and the
strides are used to decide which transfer function to use, etc.
causing lots of warnings in valgrind.
|
| | |
| | |
| | | |
Compatibility with Python3, which dosn't have string.lowercase.
|
| |/
|/|
| |
| | |
avoids unnecessary strided to contig copy for fortran arrays.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It seems it was added as a precaution to avoid breaking the rather
complicated ufunc code. It effectively disabled the skipping of the
dictionary lookup for the default values for the common case and leading
to hardly tested code in third party libraries like pandas which set the
error state to numpys old default (ignore all).
The skipping improves scalar performance by 2.5-5%.
|
|/
|
|
|
|
| |
Missing check for optional NULL argument, the case can only happen if
the error mask is 0 (the old default).
closes gh-3962
|
|\
| |
| | |
BUG: #2052 del scalar subscript causes segfault
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes issue #2052, where attempting to delete a scalar field causes a
segfault. Returns ValueError instead, like when attempting to delete an
array element.
Also added a test for this bug.
|
|\ \
| | |
| | | |
BUG: wrong boundary check in unrolled memchr
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
BUG: core: ensure __r*__ has precedence over __numpy_ufunc__
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a special case to the implementation of ndarray.__mul__ et al. that
refuses to work on other objects that are not ndarray subclasses and
implement both __numpy_ufunc__ and __r*__.
This way, execution passes first to the custom __r*__ method, which
makes it possible to have e.g. __mul__ and np.multiply do different
things.
Additionally, disable one __array_priority__ special case handling when
also __numpy_ufunc__ is defined.
|
|\ \
| | |
| | | |
DOC: Fix misleading description of random_sample in numpy.random docstring.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Exact Python scalars can never have a priority, but checking
it is expensive. This adds checks for these to the Priority
getter function.
|
|\ \ \
| | | |
| | | | |
delay error object creation to when errors occur
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
_get_global_ext_obj: retrieves global ufunc object
_get_bufsize_errmask: get only bufsize and errormask from ufunc object
_extract_pyvals: handle NULL extobj
PyUFunc_GetPyValues implemented as _get_global_ext_obj +_extract_pyvals
drop unused first_error variable.
fix errobj memory leak in previous commit.
add some test for the extobj and warning path, the warning tests are
disabled like the raising path as they fail on a bunch of platforms.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For every single operation calls, numpy has to extract value of buffersize, errormask
and name to pack and build error object. These two functions, _extract_pyvals and
PyUFunc_GetPyValues together use >12% of time.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Allows deferring evaluation until failure.
Used for blocked minmax test which evaluate array representations for
the error message many thousand times accumulating to a full second
useless runtime.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Improves speed by 10% on intel cpus.
Simplify code by moving the fenv support check into the dispatcher. fenv works
on all common platforms (including windows), the fallback is not worth it for
the exotic platforms where it might not be available.
|
| | | |
|