summaryrefslogtreecommitdiff
path: root/numpy/core/src/multiarray
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-161-0/+7
|\ \ | | | | | | 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-151-0/+7
| | | | | | | | | | | | | | | 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-151-1/+1
| | | |
* | | | 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.
* | | | 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 #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-2711-299/+121
|\ \ \ \ \ | | | | | | | | | | | | 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: Refactor internal array creation to also allow dtype preservationSebastian Berg2023-04-2611-63/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | MAINT: Move module to be `np.dtypes` and add release noteSebastian Berg2023-04-122-4/+4
| | | | | |
| * | | | | API: Add `numpy.types` module and fill it with DType classesSebastian Berg2023-04-124-43/+89
| | | | | |
| * | | | | MAINT: Refactor type naming C codeSebastian Berg2023-04-122-110/+117
| | | | | |
* | | | | | DEP: Finalize checking for sequence-like if something is array-likeSebastian Berg2023-04-251-47/+0
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | This was always just a stop-gap for shapely basically, so there is no harm finalizing things.
* | | | | DEP: deprecate scalar conversions for arrays with ndim > 0 (#10615)Nico Schlömer2023-04-204-7/+39
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR reflects some of the progress achieved in issue #10404 and is used to asses the impact of the changes. With the changes in this PR, `float(numpy.array([1.0])` now gives a warning; likewise some other things: ```python import numpy a = numpy.random.rand(10, 1) a[0] = numpy.array([1.0]) # okay a[0] = numpy.array(1.0) # okay a[0] = 1.0 # okay b = numpy.random.rand(10) b[0] = numpy.array([1.0]) # ValueError: setting an array element with a sequence. b[0, ...] = numpy.array([1.0]) # okay b[0] = numpy.array(1.0) # okay b[0] = 1.0 # okay ``` This aligns the behavior of numpy arrays with that of lists: ```python float([3.14]) ``` ``` TypeError: float() argument must be a string or a number, not 'list' ``` ```python import numpy as np a = np.random.rand(5) a[0] = [3.14] ``` ``` ValueError: setting an array element with a sequence. ``` Fixes #10404.
* | | | DOC: warn against using zero-filling loop with a previously allocated arrayNathan Goldbaum2023-04-192-0/+6
| | | |
* | | | MAINT: housecleaning for traversal loop setup and implementationsNathan Goldbaum2023-04-195-89/+96
| | | |
* | | | MAINT: support traversal loops without initializing the descriptorNathan Goldbaum2023-04-191-1/+2
| | | |
* | | | MNT: respond to review commentsNathan Goldbaum2023-04-192-15/+11
| | | |
* | | | MAINT: refactor zero-filling to use a traversal loopNathan Goldbaum2023-04-185-58/+121
| | | |
* | | | ENH: Refactor special zero-filling to be managed by the DTypeNathan Goldbaum2023-04-186-48/+77
| | | |
* | | | BUG: lib: Tiny fix for the loadtxt tokenizer when PyMem_Malloc() fails.warren2023-04-141-0/+2
|/ / /
* | | Merge pull request #23498 from ngoldbaum/buffer-error-fixCharles Harris2023-03-311-3/+11
|\ \ \ | | | | | | | | MAINT: improve error when a dtype doesn't support the buffer interface