summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | | DEP,TYP: Remove `find_common_type` typing stubs and testsSebastian Berg2022-11-074-14/+0
| | | | | | | | | |
* | | | | | | | | | DEP: Deprecate `np.find_common_type`Sebastian Berg2022-11-074-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function uses the numeric scalar common dtype/promotion rules. These are subtly different from the typical NumPy rules defined by `np.result_type`. Mainly, there is no good reason to have two subtly different rules exposed and `find_common_type` is less reliable, slower, and not really maintainable when it comes to NEP 50.
* | | | | | | | | | MAINT: Refactor AxisConcatenator to not use find_common_typeSebastian Berg2022-11-071-15/+16
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather, use `result_type` instead. There are some exceedingly small theoretical changes, since `result_type` currently uses value-inspection logic. `find_common_type` did not, because it pre-dates the value inspection logic. (I.e. in theory, this switches it to value-based promotion, just to partially undo that in NEP 50; although more changes there.) The only place where it is fathomable to matter is if someone is using `np.c_[uint8_arr, -1]` to append 255 to an unsigned integer array.
* | | | | | | | | MAINT: Ensure raw dlpack deleter works when called without the GIL (#22510)albanD2022-11-021-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ensure raw dlpack deleter works when called without the GIL * PR comments
* | | | | | | | | Merge pull request #22478 from seberg/integer-scalar-warningsMatti Picus2022-10-312-2/+10
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | BUG: -unsigned_int(0) no overflow warning
| * | | | | | | | | MAINT: Avoid warning due to unused code (for unsigned integers)Sebastian Berg2022-10-271-1/+4
| | | | | | | | | |
| * | | | | | | | | BUG: `-unsigned_int(0)` no overflow warningSebastian Berg2022-10-272-1/+6
| | | | | | | | | |
* | | | | | | | | | Merge pull request #22485 from seberg/issue-21169Charles Harris2022-10-281-13/+9
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ / |/| | | | | | | | | TST: Make test_partial_iteration_cleanup robust but require leak checker
| * | | | | | | | | TST: Make test_partial_iteration_cleanup robust but require leak checkerSebastian Berg2022-10-271-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure the test is not flaky, but the test now requires a leak checker (both valgrind or reference count based should work in CPython at least). Closes gh-21169
* | | | | | | | | | Merge pull request #22483 from mwtoews/maint-subprocessSebastian Berg2022-10-285-9/+7
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | MAINT: change subprocess arguments from Python>=3.7
| * | | | | | | | | | MAINT: change subprocess arguments from Python>=3.7Mike Taves2022-10-275-9/+7
| |/ / / / / / / / /
* | | | | | | | | | STY: Make linter happySebastian Berg2022-10-273-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not new things, but in touched lines...
* | | | | | | | | | TST: Rename setup to setup_method in f2py utils (inherited into Tests)Sebastian Berg2022-10-272-2/+2
| | | | | | | | | |
* | | | | | | | | | TST: Try using setup_class for `_Test_CCompilerOpt`Sebastian Berg2022-10-271-2/+2
| | | | | | | | | |
* | | | | | | | | | TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-2732-146/+147
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* | | | | | | | | MAINT: remove u-prefix for former Unicode strings (#22479)Mike Taves2022-10-2619-101/+103
|/ / / / / / / /
* | | | | | | | Merge pull request #22475 from DimitriPapadopoulos/reduce_pickleSebastian Berg2022-10-251-4/+0
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | MAINT: remove code specific to Python 2
| * | | | | | | | MAINT: remove code specific to Python 2Dimitri Papadopoulos2022-10-241-4/+0
| | | | | | | | |
* | | | | | | | | Merge pull request #22450 from seberg/logseries-boundsCharles Harris2022-10-246-19/+46
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | BUG: Fix boundschecking for random.logseries
| * | | | | | | | BUG: Fix boundschecking for `random.logseries`Sebastian Berg2022-10-186-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logseries previously did not enforce bounds to be strictly exclusive for the upper bound, where it leads to incorrect behavior. The NOT_NAN check is removed, since it was never used: The current bounded version always excludes NaNs.
* | | | | | | | | Merge pull request #22466 from seberg/fminmax-loopsCharles Harris2022-10-231-4/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | MAINT: Ensure that fmin loops do not show up multiple times
| * | | | | | | | | MAINT: Ensure that fmin loops do not show up multiple timesSebastian Berg2022-10-211-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not problematic for NumPy, because fmin/fmax have a custom type resolver, however, Numba relies on the order (they should not ideally, but probably have little choice currently). Even without Numba, having the multiple loops is not nice though. Closes gh-22376
* | | | | | | | | | Merge pull request #22433 from DimitriPapadopoulos/self.compiler.initializeCharles Harris2022-10-231-3/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | DOC: remove reference to Python 2
| * | | | | | | | | | DOC: remove reference to Python 2Dimitri Papadopoulos2022-10-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove reference to Visual Studio version required by old versions of Python. Python >= 3.5 is built with Microsoft Visual C++ 14.0 / Visual Studio 2015: https://wiki.python.org/moin/WindowsCompilers
* | | | | | | | | | | Merge pull request #22458 from seberg/nditer-allow-all-allocatedCharles Harris2022-10-232-19/+13
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | ENH: Allow all allocated operands in nditer/NpyIter
| * | | | | | | | | | ENH: Allow all allocated operands in nditer/NpyIterSebastian Berg2022-10-202-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows all operands to be allocated, it is necessary to provide the dtype in this case, if missing the error changes from ``ValueError`` to ``TypeError`` Closes gh-13934, gh-15140
* | | | | | | | | | | Merge pull request #22462 from mattip/npymath3Sebastian Berg2022-10-214-155/+97
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | MAINT: refactor mandatory npymath functions to #define macros
| * | | | | | | | | | | MAINT: refactor mandatory npymath functions to #define macrosmattip2022-10-204-155/+97
| | | | | | | | | | | |
* | | | | | | | | | | | Merge pull request #22456 from rossbar/deprecate-msortMatti Picus2022-10-202-5/+16
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | DEP: Proposal to deprecate the `msort` convenience function
| * | | | | | | | | | | | DOC: Update numpy/lib/function_base.py Ross Barnowski2022-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add date to deprecation in comment Co-authored-by: Matti Picus <matti.picus@gmail.com>
| * | | | | | | | | | | | DEP: Add deprecation warning and check warning in test.Ross Barnowski2022-10-192-5/+11
| | | | | | | | | | | | |
| * | | | | | | | | | | | DOC: Add deprecated directive to docstring.Ross Barnowski2022-10-191-0/+4
| | | | | | | | | | | | |
* | | | | | | | | | | | | DOC: remove mention of `ipython -p numpy`. (#22463)Matthias Bussonnier2022-10-201-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this has worked in the past 10 years. Also update because now we do have multiline past in the terminal.
* | | | | | | | | | | | | Merge pull request #16507 from seberg/nditer-writemask-reduce-maintMatti Picus2022-10-202-58/+67
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / |/| | | | | | | | | | | | BUG: Do not allow nditer to reduce the mask
| * | | | | | | | | | | | BUG: Do not allow nditer to reduce the maskSebastian Berg2022-06-092-58/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this was not checked correctly when `op_axes` were provided. Note that we may want to disallow writing to a mask completely. This also continues some maintanence started earlier, which was missing here due to the mask confusion.
* | | | | | | | | | | | | Merge pull request #22168 from ↵Matti Picus2022-10-203-41/+60
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer-Ecosystem-Engineering/remove_Avx_when_not_used ENH: Remove AVX related functions from non x86 based builds
| * | | | | | | | | | | | rm setup.py.origDeveloper-Ecosystem-Engineering2022-10-191-1186/+0
| | | | | | | | | | | | |
| * | | | | | | | | | | | review feedback, make lint happyDeveloper-Ecosystem-Engineering2022-10-195-512/+60
| | | | | | | | | | | | |
| * | | | | | | | | | | | ENH: Remove AVX related functions from non x86 based buildsDeveloper-Ecosystem-Engineering2022-08-235-15/+1672
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apple silicon builds of NumPy have extra functions in them for AVX2/AVX512. The changes here remove those implementations if we're not building for x86. Apple silicon: - original size: 3946035 bytes - new size: 3657731 bytes - savings: 288304 bytes (7.31%) Changes pass all tests on M1 native, M1 Rosetta, and iMacPro (AVX512). We've verified performance is the same before/after for Rosetta and iMacPro. We've also verified that binaries are exactly the same size and have the same number of symbols in them.
* | | | | | | | | | | | | DOC: Add note to clarify relationship between round and around (#21853)Inessa Pawson2022-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve docstring to clarify the relationship between np.round and np.around Co-authored-by: Mukulika Pahari <mukulikapahari@gmail.com>, Aparna Bushan <aparna.bushan@auto-grid.com> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | | | | | | | | | | | | ENH: unstructured_to_structured converts dtype argument (#22442)LeonaTaric2022-10-192-0/+11
| |_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: >>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=[('x', float), ('y', float)]) # failed >>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=np.dtype([('x', float), ('y', float)])) # success After: >>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=[('x', float), ('y', float)]) # success >>> field = unstructured_to_structured(np.zeros((20, 2)), dtype=np.dtype([('x', float), ('y', float)])) # success Closes gh-22428
* | | | | | | | | | | | Merge pull request #21875 from seberg/weak-scalars-safe-intsMatti Picus2022-10-188-22/+232
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / / / |/| | | | | | | | | | | ENH: Implement correct scalar and integer overflow errors for NEP 50
| * | | | | | | | | | | MAINT: Minor include fixup in scalarmath after rebase and comment fixupSebastian Berg2022-10-122-2/+2
| | | | | | | | | | | |
| * | | | | | | | | | | DOC,TST: Improve overflow error message and adjust testSebastian Berg2022-10-122-2/+3
| | | | | | | | | | | |
| * | | | | | | | | | | TST: Cover additional NEP 50 scalar pathsSebastian Berg2022-10-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Especially adding coverage also for the power operator which does not share its code perfectly.
| * | | | | | | | | | | TST: Add test to cover complex to complex64 downcast in weak promotionSebastian Berg2022-10-121-0/+9
| | | | | | | | | | | |
| * | | | | | | | | | | TST: Avoid possible warning from unnecessary cast with uninitialized valuesSebastian Berg2022-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should be fixed in `choose` to not do the unnecessary cast, see gh-22237.
| * | | | | | | | | | | TST: Rebustify NEP 50 integer tests for windows and 32bit linuxSebastian Berg2022-10-121-1/+14
| | | | | | | | | | | |
| * | | | | | | | | | | TST: Improve tests for python integer special casesSebastian Berg2022-10-121-9/+43
| | | | | | | | | | | |
| * | | | | | | | | | | BUG: Ensure new-style promotion is not accidentally used for some intsSebastian Berg2022-10-122-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the *actual* correct fix for the test adaptations. The test adaptations should only be necessary when running in weak-promotion mode, but they are NOT doing that currently.