summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | BUG: Fix needs_api for avanced assignments without subspace and remove ↵Sebastian Berg2022-06-132-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | TST: Fixup test name and check for ppc64leSebastian Berg2022-06-131-2/+6
| | | | | | |
| * | | | | | TST: Fix the weird boolean+advanced indexing testSebastian Berg2022-06-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The test meant to assert shapes, but didn't actually do it.
| * | | | | | BUG: Fix invalid access due to `iter` already being cleaned upSebastian Berg2022-06-131-2/+2
| | | | | | |
| * | | | | | ENH: Add floating point error handling to advanced indexingSebastian Berg2022-06-135-77/+142
| | | | | | |
| * | | | | | fixupsSebastian Berg2022-06-132-5/+5
| | | | | | |
| * | | | | | WIP: Threads things into nditer for ufuncs and advanced indexingSebastian Berg2022-06-136-54/+102
| | | | | | |
| * | | | | | WIP,TST: Add exhaustive test for FPEs in castsSebastian Berg2022-06-131-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...)
| * | | | | | ENH: Add overflow check to float setitemSebastian Berg2022-06-134-14/+65
| | | | | | |
| * | | | | | TST: Fixup tests that cause FPEs during castsSebastian Berg2022-06-136-27/+36
| | | | | | |
| * | | | | | BUG: Avoid FPE for float NaN to datetime/timedelta castsSebastian Berg2022-06-131-4/+14
| | | | | | |
| * | | | | | ENH: Check floating point error flags for all castsSebastian Berg2022-06-1314-100/+331
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | | | | MAINT: Remove FPE helper code that is unnecessary on C99/C++11Sebastian Berg2022-06-131-219/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | ENH: issue overflow warning when using `abs` on `np.int8(-128)` (#21648)Meekail Zain2022-06-133-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #21731 from seberg/array-function-fixup-excCharles Harris2022-06-132-1/+61
|\ \ \ \ \ \ | |/ / / / / |/| | | | | ENH: Ensure dispatcher TypeErrors report original name
| * | | | | ENH: Ensure dispatcher TypeErrors report original nameSebastian Berg2022-06-102-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | DOC: update logarithm docs as per theory. (#21587)Bhavuk kalra2022-06-131-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Merge pull request #21733 from hoodmane/fix-pointer-size-for-cross-buildMatti Picus2022-06-131-1/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH: Fix pointer size determination for cross build
| * | | | | | Update comment according to seberg's reviewHood Chatham2022-06-121-1/+3
| | | | | | |
| * | | | | | Fix lintHood Chatham2022-06-121-1/+1
| | | | | | |
| * | | | | | Handle windowsHood Chatham2022-06-121-1/+6
| | | | | | |
| * | | | | | Update numpy/linalg/setup.pyHood Chatham2022-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * | | | | | ENH: Fix pointer size determination for cross buildHood Chatham2022-06-111-1/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")`
* | | | | | Merge pull request #20924 from seberg/cleanup-scalar-fillMatti Picus2022-06-138-230/+141
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | MAINT: Simplify element setting and use it for filling
| * | | | | DOC: Add example assigning an array using fill and tweak release noteSebastian Berg2022-06-121-0/+18
| | | | | |
| * | | | | MAINT: Simplify element setting and use it for fillingSebastian Berg2022-06-127-230/+123
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | | | | Merge pull request #21735 from hoodmane/mainSebastian Berg2022-06-121-4/+3
|\ \ \ \ \ | | | | | | | | | | | | ENH: cross compilation: use sysconfig to determine if x86_64 linux
| * | | | | ENH: cross compilation: use sysconfig to determine if x86_64 linuxHood Chatham2022-06-121-4/+3
| |/ / / / | | | | | | | | | | | | | | | | | | | | Using `platform` is enquiring about the build system we want to know about the target system. We can use `sysconfig` for that.
* | | | | Merge pull request #21734 from hoodmane/check-x86-before-asmMatti Picus2022-06-121-1/+3
|\ \ \ \ \ | | | | | | | | | | | | ENH: Check that we are targeting x86 or x64 architecture before using bsr asm instruction
| * | | | | ENH: Check that we are targeting x86 or x64 before using bsr asm instructionHood Chatham2022-06-111-1/+3
| |/ / / / | | | | | | | | | | | | | | | The __asm__ is x86 asm and it won't work on other instruction sets even if we HAVE_SSE2.
* | | | | Merge pull request #20913 from seiko2plus/zsystem_supMatti Picus2022-06-1231-261/+919
|\ \ \ \ \ | | | | | | | | | | | | ENH, SIMD: Extend universal intrinsics to support IBMZ
| * | | | | ENH, SIMD: dispatch SIMD comparison for vx vxeSayed Adel2022-06-041-2/+3
| | | | | |
| * | | | | ENH, SIMD: dispatch argmax/armin for vx vxeSayed Adel2022-06-041-1/+5
| | | | | |
| * | | | | ENH, SIMD: update dispatch-able sources to support IBM ZArch SIMD"Sayed Adel2022-06-047-12/+24
| | | | | |
| * | | | | ENH, SIMD: Extend universal intrinsics to support IBMZSayed Adel2022-06-0422-246/+887
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #20914 from kinshukdua/fix_ma_meanMatti Picus2022-06-122-1/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: change `ma.mean` dtype to be consistent with `np.mean`
| * | | | | | BUG: change `ma.mean` dtype to be consistent with `np.mean`Kinshuk Dua2022-01-272-1/+16
| | | | | | |
* | | | | | | Update numpy/core/src/umath/loops_arithmetic.dispatch.c.srcSebastian Berg2022-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: Rafael Sousa <90851201+rafaelcfsousa@users.noreply.github.com>
* | | | | | | TST: Modified tests to reflect new overflowganesh-k132022-06-112-12/+20
| | | | | | |
* | | | | | | BUG, SIMD: Handle division overflow errorsganesh-k132022-06-111-17/+32
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | * 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) (#21041)Sebastian Berg2022-06-1018-434/+671
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | | | | | Merge pull request #21712 from HaoZeke/f2cmapTypeDefsCharles Harris2022-06-105-0/+30
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: `.f2py_f2cmap` doesn't map `long_long` and other options
| * | | | | | TST: Ensure long_long in f2cmap worksRohit Goswami2022-06-103-0/+25
| | | | | | |
| * | | | | | BUG: Generate C typedefs for f2cmap typesRohit Goswami2022-06-102-0/+5
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #21705 from seiko2plus/issue_21038Matti Picus2022-06-108-47/+84
|\ \ \ \ \ \ | |/ / / / / |/| | | | | BLD, SIMD: Fix detect armhf and hardened the Neon/ASIMD compile-time tests
| * | | | | fix upSayed Adel2022-06-091-1/+1
| | | | | |
| * | | | | BLD, SIMD: Fix detecting armhfSayed Adel2022-06-091-21/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strictly detects armhf via compiler definitions, to avoid building neon objects on arch armel even when the compiler supports armv7 features on it.
| * | | | | BLD, SIMD: Hardened the Neon/ASIMD compile-time testsSayed Adel2022-06-097-26/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #21709 from seberg/fixup-int-via-float-testsCharles Harris2022-06-092-0/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | TST: Fixup loadtxt int-via-float tests when in release mode
| * | | | | | TST: Fixup loadtxt int-via-float tests when in release modeSebastian Berg2022-06-092-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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