summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #22786 from asmeurer/linalg-namedtuplesHEADmainCharles Harris2023-05-174-174/+235
|\ | | | | ENH: Add namedtuple return types to linalg functions that return tuples
| * TYP: Update type annotations for the new linalg named tuplesBas van Beek2023-05-173-51/+66
| |
| * MAINT: Update numpy/linalg/linalg.pyCharles Harris2023-05-171-1/+1
| | | | | | Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
| * Fix a doctestAaron Meurer2022-12-131-1/+1
| |
| * Add namedtuple return types to linalg functions that return tuplesAaron Meurer2022-12-122-133/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That is, eig(), eigh(), qr(), slogdet(), and svd(). For those functions that return non-tuples with certain keyword arguments, the return type is unchanged. This change should be completely backwards compatible. The namedtuple attribute names come from the array API specification (see, e.g., https://data-apis.org/array-api/latest/extensions/generated/signatures.linalg.eigh.html), with the exception of eig() which is just the same as eigh(). The name of the namedtuple object itself is not part of the specification or the public API. I have not used a namedtuple for the tuple output for qr(mode='raw'), which returns (h, tau). This updates the docstrings to use the updated namedtuple return names, and also the examples to use those names more consistently. This also updates the tests to check each function for the namedtuple attributes at least once.
* | 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
* | | | | TYP: Relax the `genfromtxt` return dtype when the dtype is unspecifiedBas van Beek2023-05-162-6/+6
| | | | |
* | | | | 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 #23727 from F3eQnxN3RriK/doc-patch-2Charles Harris2023-05-141-15/+13
|\ \ \ \ \ | | | | | | | | | | | | DOC: Rewrite docstrings of `ogrid` and `mgrid`
| * | | | | DOC: Rewrite docstrings of `ogrid` and `mgrid`Yuki2023-05-061-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | Removed references to `nd_grid` instead of adding a document (gh-23612).
* | | | | | MNT: compatibility with cython3Thomas A Caswell2023-05-132-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | This is fallout from https://github.com/cython/cython/pull/5386
* | | | | | MAINT: Remove ``find_common_type`` export.Charles Harris2023-05-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove `find_common_type` export from `numpy/__init__.pyi`.
* | | | | | Merge branch 'main' into deprecate-find-common-typeCharles Harris2023-05-13504-14176/+24757
|\ \ \ \ \ \
| * \ \ \ \ \ 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
| | | | | | | |
| * | | | | | | BUG: properly handle tuple keys in NpZFile.__getitem__ (#23757)Nathan Goldbaum2023-05-122-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUG: properly handle tuple keys in NpZFile.__getitem__ * TST: test tuple rendering specifically. --------- Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
| * | | | | | | Merge pull request #23599 from HaoZeke/f2pyEndIfFixCharles Harris2023-05-123-3/+22
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | BUG: Fix crackfortran groups for endifs with comments
| | * | | | | | | MAINT: Fix merge errorRohit Goswami2023-05-121-13/+0
| | | | | | | | |
| | * | | | | | | BUG: Fix matching endifs with commentsRohit Goswami2023-05-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonizes patterns a bit as well
| | * | | | | | | TST: Add a test for gh-23533Rohit Goswami2023-05-122-0/+32
| | | | | | | | |
| * | | | | | | | DOC: Rm bool8 alias from _add_newdoc_for_scalar.Ross Barnowski2023-05-121-1/+1
| |/ / / / / / /
| * | | | | | | Merge pull request #23753 from charris/disable-spr-on-clangCharles Harris2023-05-121-0/+4
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | MAINT, BLD: Disable spr for clang
| | * | | | | | | MAINT, BLD: Disable spr for clangCharles Harris2023-05-111-0/+4
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang has a bug and fails when compiling `simd_qsort_16bit.dispatch.avx512_spr.cpp` Closes #23730.
| * | | | | | | DOC:clarify differences between ravel and reshape(-1)渡邉 美希2023-05-111-4/+6
| | |_|/ / / / | |/| | | | |
| * | | | | | Merge pull request #23743 from paulromano/poly-docstrings-symbolCharles Harris2023-05-106-0/+36
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | DOC: Add symbol in docstring for classes derived from ABCPolyBase
| | * | | | | | DOC: Add symbol in docstring for classes derived from ABCPolyBasePaul Romano2023-05-106-0/+36
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'symbol' argument was added in ABCPolyBase in 1.24 and documented there, but the docstrings for derived classes (e.g., Polynomial) were not updated.
| * | | | | | 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.
| * | | | | | BUG: fix the method for checking local files (#23728)Hongyang Peng2023-05-092-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BufferedReader and BufferedWriter cannot be used to determine local files. For example, users can implement CustomFile to operate on OSS files, and then use BufferedReader(CustomFile) to achieve the buffered effect. But fileno method can do it.
| * | | | | | Merge pull request #23705 from seberg/windowing-annoyanceCharles Harris2023-05-081-10/+38
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | MAINT: Reorganize the way windowing functions ensure float64 result
| | * | | | | | MAINT: Reorganize the way windowing functions ensure float64 resultSebastian Berg2023-05-031-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This roughly changes things so that we ensure a float64 working values up-front. There is a tiny chance of precision changes if the input was not float64 or error changes on bad input. I don't think this should matter in practice, precision changes (as far as I can tell) should happen rather the other way around. Since float64 has 53bits mantissa, I think the arange should give the correct result reliably for any sensible inputs. There is an argument to be made that the windowing functions could return float32 for float32 input, but I somewhat think this is OK and users can be expected to just cast manually after the fact. The result type is tested, but this ensures the tests pass also when enabling weak promotion.
| * | | | | | | TYP,BUG: Add annotations for missing `max`, `min` and `round` aliasesBas van Beek2023-05-081-0/+4
| | | | | | | |
| * | | | | | | TYP: Re-export the `np.dtypes` namespaceBas van Beek2023-05-082-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xref https://github.com/numpy/numpy/pull/23358