| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
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
|
|\ \
| | |
| | | |
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.
|
| |/
|/|
| |
| | |
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: 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.
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
C identifiers aren't allowed to match "^_[A-Z]". Fixed that in
numpyos.c and removed some more useless underscores.
Changed NumPyOS_ascii_tolower and the code that calls it to handle
ints, not chars. C promotes char to int in so many situations that
char variables are just a pain. (The C standard library uses int
in <ctype.h>, for example.)
|
|/
|
|
|
|
| |
The function takes a considerable amount of time of np.take and
to also fancy indexing. Simple np.takes can speed up by more then
40%, fancy indexes around 10%.
|
|\
| |
| | |
BUG: test_fortran_order_buffer fails on big endian architectures.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The numpy unicode string comparison function does not work correctly
for non-native byte orders. That is a problem needing fixing, but
test_fortran_order_buffer is only needed to check that the buffer
works correctly for fortran order buffers, so let the endianess of
test data be the platform default.
|
|/
|
|
|
| |
Lead to build failures on s390 (32bit user space).
Patch by Charles Harris
|
|\
| |
| | |
MAINT: Define NPY_NO_DEPRECATED_API in struct_ufunc_test.c.src
|
| |
| |
| |
| |
| | |
Removes a compile warning and makes the function use proper macro
replacements. Also fix a pointer type mismatch warning.
|
|\ \
| | |
| | | |
move memchr like code to a function
|
| | |
| | |
| | |
| | |
| | | |
Improves sparse mask performance by about a factor of three, the worst
case of no consecutive mask elements slows down by about 10%-15%.
|
| | |
| | |
| | |
| | | |
useful for small sizes where the function call is expensive.
|
| | | |
|
| |/
| |
| |
| |
| |
| | |
currently only i386 and amd64, must be used carefully as the compiler
may still be allowed to assume alignment and try to vectorize based on
type size alignment.
|
|\ \
| | |
| | | |
DOC: fixed correlate docstring.
|
| | |
| | |
| | |
| | |
| | | |
Replaced typeset formulas by pure ASCII equivalents. Should now be
easier to read in source files.
|
| | |
| | |
| | |
| | |
| | | |
Replaced correlation formula with corrected version that matches the
numpy implementation. Added comment on possible further different
definitions of correlation. Added examples.
|
|\ \ \
| | | |
| | | | |
add spaces to literal string concatination for C++11 compatibility
|
| | | |
| | | |
| | | |
| | | |
| | | | |
literal string concatination without spaces not
allowed in C++11 anymore
|
|\ \ \ \
| |/ / /
|/| | | |
BUG: fix declaration-after-statement
|
| | |/
| |/|
| | |
| | | |
closes gh-3930
|
|\ \ \
| |/ /
|/| | |
BUG Masked arrays treated incorrectly in isclose(..,..,equal_nan=True)
|
| |/ |
|
| |
| |
| |
| |
| | |
Since NpyIter keeps track of the total size, this cannot be
larger then npy_intp, so that an overflow check is necessary.
|