| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
unnecessary delay
The delay is not necessary, because the iterator does not cast in any case, so we do not
actually care about the possibility of errors being raised.
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The test meant to assert shapes, but didn't actually do it.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
unfortunately, I had to realize that float -> integer casts are not
well defined when values are out of range for the integer.
This is a problem with C, but means that neither the warnings seem
to be particularly well defined...
(I suspect, on my CPU it either warns OR gives "valid" integer overflow
results, but the question is if that is even universally true...)
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
To achieve this, I first need to propagate the ArrayMethod information
that FPE flags _may_ be given for a specific cast.
This requires quite a bit of changes (which is arguably the more annoying
part of the PR/commit).
Note that for some "legacy" casts, we do not modify this and assume that
the only interesting information is `needs_api`.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
C99 and C++11 standardize `fenv.h`, so we should not need the manual
definitions for these functions for platforms that do not support it.
See e.g.: https://en.cppreference.com/w/c/numeric/fenv
If issues come up, the code can be restored.
This applies gh-21421 again, since we had to revert using the cpp file
and the change thus got lost.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Checks condition a == NPY_MIN_@NAME@ to determine whether an overflow error has occurred for np.int8 type. See #21289 and #21188 (comment) for reference.
This also adds error integer overflow handling to the `-scalar` paths and "activates" a test for the unsigned versions.
A few tests are skipped, because the tests were buggy (they never ran). These paths require followups to fix.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
ENH: Ensure dispatcher TypeErrors report original name
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This replaces the name in the TypeError with the actually raised
name. In principle we could add one more check, because a
signature related TypeError must have a traceback with exactly
one entry (so `sys.exc_info()[2].tb_next is None`).
In practice this seems unnecessary though.
This ensures the following message:
>>> np.histogram(asdf=3)
TypeError: histogram() got an unexpected keyword argument 'asdf'
Closes gh-21647
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Made some changes addressing the discussions in Issue #21235 .
What this PR updates
Range of log functions in the Docs
Adds Additional Notes on the theoretical range outcomes. -pi
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
ENH: Fix pointer size determination for cross build
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | | |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Using `sys` to ask about the build Python is hostile to cross
building because it is very hard to replace the sys module with one
that gives info about the target system. On the other hand, the
sysconfig data can be replaced by setting _PYTHON_SYSCONFIGDATA_NAME.
So instead of using `sys.maxsize` to determine pointer size, use
`sysconfig.get_config_var("SIZEOF_VOID_P")`
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
MAINT: Simplify element setting and use it for filling
|
| | | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This slightly modifies the behaviour of `arr.fill()` to be
`arr.fill(scalar)`, i.e. match `arr1d[0] = scalar`, rather than
`arr.fill(np.asarray(scalar))`, which subtely different!
(Note that object was already special cased to have the scalar
logic.)
Otherwise, `PyArray_Pack` is now the actual, full featured, "scalar"
assignment logic. It is a bit strange due to that quantity/masked
array issue, but there is nothing to be done about it.
The simplifications in `PyArray_AssignFromCache` should not cause
any change in practice, because non 0-D arrays would have been
rejected earlier on in that path.
(Basically, it does not need the full `PyArray_Pack` logic, but that
is fine, I intially split the two, but consolidated them again.)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
ENH: cross compilation: use sysconfig to determine if x86_64 linux
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | | |
Using `platform` is enquiring about the build system we want to know
about the target system. We can use `sysconfig` for that.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
ENH: Check that we are targeting x86 or x64 architecture before using bsr asm instruction
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
The __asm__ is x86 asm and it won't work on other instruction sets even if we HAVE_SSE2.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
ENH, SIMD: Extend universal intrinsics to support IBMZ
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It covers SIMD operations for all datatypes starting
from z/Arch11 a.k.a IBM Z13, except for single-precision
which requires minimum z/Arch12 a.k.a IBMZ 14 to be dispatched.
This patch rename the branch /simd/vsx to /simd/vec, the new
the path is hold the definitions of universal intrinsics for
both Power and Z architectures.
This patch also adds new preprocessor identifiers:
* NPY_SIMD_BIGENDIAN: 1 if the enabled SIMD extension
is running on big-endian mode otherwise 0.
* NPY_SIMD_F32: 1 if the enabled SIMD extension
supports single-precision otherwise 0.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
BUG: change `ma.mean` dtype to be consistent with `np.mean`
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | | |
Co-authored-by: Rafael Sousa <90851201+rafaelcfsousa@users.noreply.github.com>
|
| | | | | | | |
|
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | | |
* If a types minimum value is divided by -1, an overflow will be raised
and result will be set to minimum
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* ENH: Implement string comparison ufuncs (or almost)
This makes all comparison operators and ufuncs work on strings
using the ufunc machinery.
It requires a half-manual "ufunc" to keep supporting void comparisons
and especially `np.compare_chararrays` (that one may have a bit more
overhead now).
In general the new code should be much faster, and has a lot of easier
optimization potential. It is also much simpler since it can outsource
some complexities to the ufunc/iterator machinery.
This further fixes a couple of bugs with byte-swapped strings.
The backward compatibility related change is that using the normal
ufunc machinery means that string comparisons between string and
unicode now give a `FutureWarning` (instead of just False).
* MAINT: Do not use C99 tagged struct init in C++
C++ does not like it (at least not before C++20)... GCC and clang
don't seem to mind, but MSVC seems to.
* BENCH: Add basic string comparison benchmarks
* DOC,STY: Fixup string-comparisons comments based on review
Thanks to Marten's comments, a few clarfications and slight fixups.
* ENH: Use `memcmp` because it may be faster for the byte case
* TST: Improve string and unicode comparison tests.
* MAINT: Use switch statement based on review
As suggested be Serge.
Co-authored-by: Serge Guelton <serge.guelton@telecom-bretagne.eu>
* TST: Make unicode byte-swap test slightly more concrete
The issue is that the `view` needs to use native byte-order, so
just ensure native byte-order for the view, and then do another cast
to get it right.
* BUG: Add `np.compare_chararrays` to test and fix typo
* TST: Add test for empty string comparisons
* TST: Fixup string test based on martens review
* MAINT: Move definitions back into string_ufuncs.h
* MAINT: Use enum class for comparison operator templating
This removes the need for a dynamic (or static) assert in the
switch statement.
* Template version of add_loop to avoid redundant code
* STY: Fixup style, two spaces, error is -1
* STY: Small `string_ufuncs.cpp` fixups based on Serge's review
* MAINT: Fix merge conflict (ensure_dtype_nbo was removed)
Co-authored-by: Serge Guelton <serge.guelton@telecom-bretagne.eu>
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
BUG: `.f2py_f2cmap` doesn't map `long_long` and other options
|
| | | | | | | |
|
| | |_|_|/ /
| |/| | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
BLD, SIMD: Fix detect armhf and hardened the Neon/ASIMD compile-time tests
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Strictly detects armhf via compiler definitions,
to avoid building neon objects on arch armel even when
the compiler supports armv7 features on it.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid passing any constants or traced pointers to avoid
compiler optimizations, so we make the sure the required
instructions have been tested against the linker.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
TST: Fixup loadtxt int-via-float tests when in release mode
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
In release mode, the DeprecationWarning is not automatically raised,
so we need to ensure this using a warning filter.
(Also add missing metadata/info to the deprecation tests)
Closes gh-21706
|