summaryrefslogtreecommitdiff
path: root/numpy/core
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #23505 from cbrt64/fix-2256Matti Picus2023-05-172-7/+14
|\ | | | | 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-312-4/+8
| | | | | | | | Addresses #2256
* | Merge pull request #23763 from seberg/nep50-fixes-part2Charles Harris2023-05-163-3/+86
|\ \ | | | | | | 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-152-5/+17
| | |
| * | BUG: Fix weak scalar logic for large ints in ufuncsSebastian Berg2023-05-153-3/+74
| | | | | | | | | | | | | | | 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-162-2/+102
|\ \ \ | | | | | | | | 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
| | | |
| * | | TST: Skip test on older Python versions which use `__name__`Sebastian Berg2023-04-251-0/+6
| | | |
| * | | ENH: Restore TypeError cleanup in array function dispatchingSebastian Berg2023-04-252-2/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 branch 'main' into deprecate-find-common-typeCharles Harris2023-05-13292-10086/+19755
|\ \ \ \
| * \ \ \ Merge pull request #23746 from mattip/scalar-strCharles Harris2023-05-132-3/+40
| |\ \ \ \ | | | | | | | | | | | | ENH: add fast path for str(scalar_int)
| | * | | | BUG: typo, lintingmattip2023-05-112-2/+1
| | | | | |
| | * | | | add fast path for str(scalar_int)mattip2023-05-102-2/+40
| | | | | |
| * | | | | DOC: Rm bool8 alias from _add_newdoc_for_scalar.Ross Barnowski2023-05-121-1/+1
| | | | | |
| * | | | | DOC:clarify differences between ravel and reshape(-1)渡邉 美希2023-05-111-4/+6
| | |/ / / | |/| | |
| * | | | 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.
| * | | | TYP,BUG: Add annotations for missing `max`, `min` and `round` aliasesBas van Beek2023-05-081-0/+4
| | | | |
| * | | | TYP: Let `np.einsum` accept `object` dtypesBas van Beek2023-05-081-5/+48
| | | | | | | | | | | | | | | | | | | | xref https://github.com/numpy/numpy/pull/18053
| * | | | Merge pull request #23713 from seberg/uint-int-comparisonsCharles Harris2023-05-065-23/+173
| |\ \ \ \ | | | | | | | | | | | | ENH: Make signed/unsigned integer comparisons exact
| | * | | | ENH: Make signed/unsigned integer comparisons exactSebastian Berg2023-05-045-23/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-032-14/+101
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | MAINT: refactor PyArray_Repeat to avoid PyArray_INCREF
| | * | | | | TST: test object dtype in test_repeatNathan Goldbaum2023-05-031-2/+3
| | | | | | |
| | * | | | | 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-033-53/+312
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | 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-083-53/+312
| | | | | | | |
| * | | | | | | Merge pull request #23700 from rossbar/doc/fix-23664Sebastian Berg2023-05-021-8/+7
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | DOC: Resolve length/index ambiguity in numpy.outer docstring
| | * | | | | | | DOC: add back reference.Ross Barnowski2023-05-021-3/+3
| | | | | | | | |
| | * | | | | | | DOC: fix reference formatting.Ross Barnowski2023-05-021-3/+3
| | | | | | | | |
| | * | | | | | | DOC: fix indexing inconsistency in outer docstring.Ross Barnowski2023-05-021-6/+5
| | | | | | | | |
| * | | | | | | | xfail underflowing scalar sinChris Sidebottom2023-05-021-0/+4
| | | | | | | | |
| * | | | | | | | Add test case for underflow exceptionChris Sidebottom2023-05-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Pierre Blanchard <Pierre.Blanchard@arm.com>
| * | | | | | | | 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 #23528 from seberg/allow-backcomp-buildsMatti Picus2023-04-2810-57/+155
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | ENH: Allow, and default to, downstream building with old API
| | * | | | | | | Apply suggestions from code reviewSebastian Berg2023-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>