summaryrefslogtreecommitdiff
path: root/numpy/core/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #23505 from cbrt64/fix-2256Matti Picus2023-05-171-6/+13
|\ | | | | BUG: Use 2GiB chunking code for fwrite() on mingw32/64
| * MAINT: Use fwrite chunking generally on Windows 64 and size_t as typeSebastian Berg2023-05-161-6/+9
| | | | | | | | | | | | | | This is a bit too broad because msys UCRT runtime may actually not need it. Changes the type in the loop to `size_t`. This is not necessary but the current constants are buggy without it if the branch is accidentally used on 32bit.
| * BUG: Use 2GiB chunking code for fwrite() on mingw32/64Edward E2023-03-311-3/+7
| | | | | | | | Addresses #2256
* | Merge pull request #23763 from seberg/nep50-fixes-part2Charles Harris2023-05-162-3/+42
|\ \ | | | | | | BUG: Fix weak scalar logic for large ints in ufuncs
| * | MAINT: Fix typo in commentSebastian Berg2023-05-151-1/+1
| | |
| * | MAINT: Address Marten's reviewSebastian Berg2023-05-151-4/+4
| | |
| * | BUG: Fix weak scalar logic for large ints in ufuncsSebastian Berg2023-05-152-3/+42
| | | | | | | | | | | | | | | This fixes it, breaks warnings (partially), but most or all of those paths should be errors anyway.
* | | Merge pull request #23659 from seberg/issue-23029Charles Harris2023-05-161-1/+84
|\ \ \ | | | | | | | | ENH: Restore TypeError cleanup in array function dispatching
| * | | MAINT: Seems it should be -1 direction for matching a prefixSebastian Berg2023-04-251-2/+2
| | | | | | | | | | | | | | | | Not that it mattered, but docs say direction should be either -1 or 1
| * | | BUG: Add missing decref's of replaced error.Sebastian Berg2023-04-251-0/+3
| | | |
| * | | ENH: Restore TypeError cleanup in array function dispatchingSebastian Berg2023-04-251-1/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the dispathcer raises a TypeError and it starts with the dispatchers name (or actually __qualname__ not that it normally matters), then it is nicer for users if we just raise a new error with the public symbol name. Python does not seem to normalize exception and goes down the unicode path, but I assume that e.g. PyPy may not do that. And there might be other weirder reason why we go down the full path. I have manually tested it by forcing Normalization. Closes gh-23029
* | | | MAINT: fix signed/unsigned int comparison warningsNathan Goldbaum2023-05-152-2/+2
| | | |
* | | | Merge pull request #23665 from r-devulap/update-simd-sortCharles Harris2023-05-151-0/+0
|\ \ \ \ | | | | | | | | | | ENH: Speed up 64-bit qsort by 1.6x
| * | | | ENH: Speed up 64-bit qsort by 1.6xRaghuveer Devulapalli2023-05-141-0/+0
| | |/ / | |/| |
* | | | Merge pull request #23750 from ngoldbaum/replace-copyswapnSebastian Berg2023-05-151-15/+91
|\ \ \ \ | |/ / / |/| | | MAINT: do not use copyswapn in array sorting internals
| * | | MAINT: do not use copyswapn in array sorting internalsNathan Goldbaum2023-05-121-15/+91
| | | |
* | | | Merge pull request #23746 from mattip/scalar-strCharles Harris2023-05-131-1/+37
|\ \ \ \ | |/ / / |/| | | ENH: add fast path for str(scalar_int)
| * | | BUG: typo, lintingmattip2023-05-111-1/+1
| | | |
| * | | add fast path for str(scalar_int)mattip2023-05-101-1/+37
| | | |
* | | | Merge pull request #23620 from seberg/correct-zerofill-structuredCharles Harris2023-05-106-92/+202
|\ \ \ \ | |/ / / |/| | | MAINT: Add a proper implementation for structured zerofill
| * | | MAINT: Rename `traverse_func_get` and type for clarity as per reviewSebastian Berg2023-05-101-6/+6
| | | |
| * | | MAINT: Add a proper implementation for structured zerofillSebastian Berg2023-04-206-92/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reorganizes the generic traversal functions for structured dtypes a bit (before it wasn't quite generic). Then uses that for zerofilling. We could get the two a bit closer by also supporting `func==NULL` explicitly for clearing. (I have not includes this here.) The old `FillObjectArray` is still in use now, this is not ideal and the new approach should be duplicated to add an "emptyfill" (same semantics, normally just memset to 0, but for objects we place an explicit `None` object). This is a necessary follow-up to gh-23591.
* | | | Merge pull request #23713 from seberg/uint-int-comparisonsCharles Harris2023-05-063-10/+76
|\ \ \ \ | | | | | | | | | | ENH: Make signed/unsigned integer comparisons exact
| * | | | ENH: Make signed/unsigned integer comparisons exactSebastian Berg2023-05-043-10/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes comparisons between signed and unsigned integers exact by special-casing promotion in comparison to never promote integers to floats, but rather promote them to uint64 or int64 and use a specific loop for that purpose. This is a bit lazy, it doesn't make the scalar paths fast (they never were though) nor does it try to vectorize the loop. Thus, for cases that are not int64/uint64 already and require a cast in either case, it should be a bit slower. OTOH, it was never really fast and the int64/uint64 mix is probably faster since it avoids casting. --- Now... the reason I was looking into this was, that I had hoped it would help with NEP 50/weak scalar typing to allow: uint64(1) < -1 # annoying that it fails with NEP 50 but, it doesn't actually, because if I use int64 for the -1 then very large numbers would be a problem... I could probably(?) add a *specific* "Python integer" ArrayMethod for comparisons and that could pick `object` dtype and thus get the original Python object (the loop could then in practice assume a scalar value). --- In either case, this works, and unless we worry about keeping the behavior we probably might as well do this. (Potentially with follow-ups to speed it up.)
* | | | | Bug: Fix compilation of halffloat with gcc 13.1Sayed Adel2023-05-042-1/+2
| | | | |
* | | | | Merge pull request #23435 from r-devulap/spr-simd-sortMatti Picus2023-05-042-4/+12
|\ \ \ \ \ | | | | | | | | | | | | ENH: Use AVX512 FP16 ISA for sorting float16 arrays
| * | | | | ENH: Use x86-simd-sort to disptch avx512_qsort<_Float16>Raghuveer Devulapalli2023-04-051-4/+12
| | | | | |
| * | | | | MAINT: Update x86-simd-sort to latest commitRaghuveer Devulapalli2023-04-051-0/+0
| | | | | |
* | | | | | Merge pull request #23699 from ngoldbaum/repeat-remove-array-increfSebastian Berg2023-05-031-12/+98
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | MAINT: refactor PyArray_Repeat to avoid PyArray_INCREF
| * | | | | MAINT: apply specialization optimizationNathan Goldbaum2023-05-021-23/+83
| | | | | |
| * | | | | MAINT: refactor to use chunked castsNathan Goldbaum2023-05-021-8/+9
| | | | | |
| * | | | | MAINT: refactor PyArray_Repeat to avoid PyArray_INCREFNathan Goldbaum2023-05-021-2/+27
| | | | | |
* | | | | | Merge pull request #22137 from Micky774/enable_simdMatti Picus2023-05-032-51/+96
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH allow for specifying CPU features to enable via `NPY_ENABLE_CPU_FEATURES` environment variable
| * | | | | | ENH: add NPY_ENABLE_CPU_FEATURES to allow limiting set of enabled featuresMeekail Zain2023-04-082-51/+96
| | | | | | |
* | | | | | | BUG: Correct sin/cos float64 range check functionsChris Sidebottom2023-05-021-2/+2
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I translated range checks for [sin](https://github.com/ARM-software/optimized-routines/blob/91d5bbc3091fa568e6856c7c41f9d7492d5957df/math/v_sin.c#L68): ```c cmp = v_cond_u64 ((ir >> 52) - TinyBound >= Thresh); ``` and [cos](https://github.com/ARM-software/optimized-routines/blob/91d5bbc3091fa568e6856c7c41f9d7492d5957df/math/v_cos.c#L56): ```c cmp = v_cond_u64 (v_as_u64_f64 (r) >= v_as_u64_f64 (RangeVal)); ``` They ended up the wrong way around, this corrects it.
* | | | | | Merge pull request #18053 from Iamsoto/adding_object_to_einsumSebastian Berg2023-04-284-22/+112
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH: Adding Object dtype to einsum
| * | | | | | fixes from reviewmattip2023-04-272-24/+21
| | | | | | |
| * | | | | | MAINT: expand PyArray_AssignZero to handle object dtypemattip2023-03-303-38/+24
| | | | | | |
| * | | | | | BUG: work around shortcoming in PyArray_AssignZero for object dtypemattip2023-03-301-2/+15
| | | | | | |
| * | | | | | BUG: only check PyErr_Occurred if Python C-API is neededmattip2023-03-301-4/+8
| | | | | | |
| * | | | | | BUG: if dtype is object, do outbuf[:] = 0 rather than memsetmattip2023-03-301-1/+13
| | | | | | |
| * | | | | | Update numpy/core/src/multiarray/einsum_sumprod.c.src The Dog Lulu2023-03-291-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementing Erics suggestions Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | | | | | PR_fixes_1iamsoto2023-03-292-52/+31
| | | | | | |
| * | | | | | WIP: Adding Object dtype to einsumiamsoto2023-03-291-5/+112
| | | | | | |
* | | | | | | Merge pull request #23666 from seberg/subarray-cleanupMatti Picus2023-04-2712-306/+122
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | DEP,BUG: Finalize subarray dtype FutureWarning and fix its assignment
| * | | | | | | DEP: Finalize subarray from non-subarray creation futurewarningSebastian Berg2023-04-262-236/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This unfortunately switches over the C-only path when FromArray is called with a subarray dtype. Together with the previous commit (which is very simple but in a sense does the heavy lifting): Closes gh-23083
| * | | | | | | MAINT: Fixup handling of subarray dtype in ufunc.resolve_dtypesSebastian Berg2023-04-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is now OK to just support, we won't replace things and things should work out for the most part (probably).
| * | | | | | | MAINT: Refactor internal array creation to also allow dtype preservationSebastian Berg2023-04-2612-64/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases we know that we want to use the *exact* dtype that we already have (mainly when taking views). This is also useful internally because there are very rare code-paths were we even create temporary arrays that contain subarray dtypes.
* | | | | | | | Merge pull request #23358 from seberg/dtype-class-in-typesMatti Picus2023-04-276-153/+206
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | API: Add DType classes into new `numpy.dtypes` module
| * | | | | | | Apply suggestions from code reviewSebastian Berg2023-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>