summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* BUG, SIMD: Fix unsigned 8-bit integer divison by a scalarissue_20025Sayed Adel2021-10-231-1/+1
| | | | | | Same as 64-bit divistion, except quad wide divison leads to inaccurate multiplier in certain cases when the log2 of the divisor overflow to zero.
* TST, SIMD: Enhance the test case for SIMD integer division by adding several ↵Sayed Adel2021-10-231-50/+25
| | | | data ranges
* BUG, SIMD: Fix 64-bit integer divison by a scalar on MSVC <= 2017Sayed Adel2021-10-211-2/+3
| | | | | | The multiplier factor that used for integer division wasn't correctly calculated due inaccurate implementation of the emulated version of intrinsic `_udiv128`.
* Merge pull request #20149 from charris/post-1.21.3-release-updateCharles Harris2021-10-203-0/+73
|\ | | | | REL: Update main after 1.21.3 release.
| * REL: Update main after 1.21.3 release.Charles Harris2021-10-203-0/+73
| |
* | Merge pull request #20142 from WarrenWeckesser/update-parse-sig-commentMatti Picus2021-10-201-3/+18
|\ \ | |/ |/| MAINT: core: Update the comment about _parse_signature with more complete info.
| * MAINT: core: Update the comment about _parse_signature with more complete info.Warren Weckesser2021-10-191-3/+18
|/
* Merge pull request #20137 from arushi-08/reword-array-has-one-axisMelissa Weber Mendonça2021-10-191-4/+5
|\ | | | | DOC: Reword array has one axis
| * DOC:Reword array has one axisArushi Sharma2021-10-191-4/+5
| |
* | Merge pull request #20136 from WarrenWeckesser/fix-npyiter-deallocate-checkSebastian Berg2021-10-193-1/+19
|\ \ | |/ |/| BUG: core: Fix incorrect check of NpyIter_Deallocate return value.
| * BUG: core: Fix incorrect check of NpyIter_Deallocate return value.warren2021-10-193-1/+19
|/ | | | | | | NpyIter_Deallocate returns 0 for failure and 1 for success, so the check `NpyIter_Deallocate(iter) < 0` is not correct. (See relevant comments in gh-20069.)
* Merge pull request #18905 from seberg/ufunc-refactor-2021Matti Picus2021-10-1916-521/+866
|\ | | | | MAINT: Refactor reductions to use NEP 43 style dispatching/promotion
| * TST: Add a test covering logical ufuncs for custom DTypesSebastian Berg2021-10-112-0/+72
| | | | | | | | | | | | In particular, this covers a casting error that currently cannot be hit for normal ufuncs, because they already check casting during the legacy dtype resolution (which is called first).
| * DOC: Comment fixups based on Marten's reviewSebastian Berg2021-10-113-7/+11
| |
| * MAINT: Fixups and new tests based on Marten's reviewsSebastian Berg2021-10-114-27/+52
| | | | | | | | | | | | | | | | | | More fixups are coming, the biggest change is that the error message is now improved when a reduction makes no sense such as `np.subtract.reduce(np.array([1, 2, 3], dtype="M8[s]"))` where input and output cannot have the same descriptor. (Some more fixups still to go)
| * BUG: Fixup and add tests for logical ufuncsSebastian Berg2021-10-111-2/+9
| |
| * TST: Add test for reduceat/accumulate output shape mismatchSebastian Berg2021-10-112-2/+22
| | | | | | | | | | | | | | At least the reduceat path seems to have been untested before. The slight change in code layout (added assert) is just to make the code slightly easier to read. Since otherwise it looks like there is an additional `else` branch when `out` is given.
| * BUG: Fix unsupplied DType path in dispatchingSebastian Berg2021-10-111-5/+2
| | | | | | | | | | | | | | This did not actually trigger any problems, probably because the reduce fallback mode later just catches it anyway... On the upside, this probably fixes most of the caching issues ;)
| * MAINT: Remove unnecessary assert that may trip 32 bitSebastian Berg2021-10-111-3/+0
| | | | | | | | | | | | Mainly to see if this is indeed the problem, but the assert is not necessary, and it might be we end up with the wrong dtype when the input is a compatible (but different) integer already?
| * TST: Add test for ufunc out-cast failure when input cast is ignoredSebastian Berg2021-10-111-0/+10
| |
| * TST: Add additional reduceat/accumulate testsSebastian Berg2021-10-111-0/+17
| |
| * TST: Add test for rare reduce dtype mismatch error pathSebastian Berg2021-10-111-0/+16
| |
| * BUG: Add forgotten fix for needs-api for reduceatSebastian Berg2021-10-111-1/+3
| |
| * BUG: Fixup some refcounting and remove unused error pathSebastian Berg2021-10-111-11/+12
| |
| * MAINT: Refactor reductions to use NEP 43 style dispatching/promotionSebastian Berg2021-10-1112-512/+689
| | | | | | | | | | | | | | | | This also implements new promoters for the logical functions. The reasoning is that any logical function can always be handled by first casting to boolean without changing the meaning. This is true (unless the output is object), and already effectively used for `np.all`/`np.any`.
* | Merge pull request #20130 from numpy/dependabot/pip/hypothesis-6.23.3Charles Harris2021-10-181-1/+1
|\ \ | | | | | | MAINT: Bump hypothesis from 6.23.2 to 6.23.3
| * | MAINT: Bump hypothesis from 6.23.2 to 6.23.3dependabot[bot]2021-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.23.2 to 6.23.3. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.23.2...hypothesis-python-6.23.3) --- updated-dependencies: - dependency-name: hypothesis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* | | ENH: Create an experimental export of the new DType API (#19919)Sebastian Berg2021-10-1811-76/+817
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Create an experimental export of the new DType API This expposes an experimental DType and ufunc API. It can be used by including the experimental header AND setting the `NUMPY_EXPERIMENTAL_DTYPE_API=1` environment variable. A user must further call: if (import_experimental_dtype_api(version) < 0) { return NULL; } with a strict version check that will error on any mismatch. At this time, I _know_ that some changes will happen, but it feels like it may be a good idea to make this public anyway, with all the problems attached... (e.g. as of now ufunc reductions will just not work, since that PR is not yet merged.) Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | Merge pull request #20123 from rossbar/doc/np-iterable-0d-arraysMelissa Weber Mendonça2021-10-181-0/+13
|\ \ | | | | | | DOC: Add note to iterable docstring about 0d arrays.
| * | Add note to iterable docstring about 0d arrays.Ross Barnowski2021-10-151-0/+13
|/ / | | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* | Merge pull request #20119 from PeterTillema/patch-1Warren Weckesser2021-10-141-1/+0
|\ \ | | | | | | DOC: Remove double property ctypes from ndarray
| * | DOC: Remove double property ctypes from ndarrayPeter Tillema2021-10-141-1/+0
|/ / | | | | Fix #20117
* | Merge pull request #20111 from sl4mmy/patch-1Melissa Weber Mendonça2021-10-131-1/+1
|\ \ | | | | | | DOC: fix minor typo in comment
| * | fix minor typo in commentKent R. Spillner2021-10-131-1/+1
|/ /
* | Merge pull request #20105 from BvB93/matrixCharles Harris2021-10-124-52/+211
|\ \ | | | | | | ENH: Add annotations for `np.matrix`
| * | TST: Add typing tests for `np.matrix`Bas van Beek2021-10-121-0/+69
| | |
| * | ENH: Add annotations for `np.matrix`Bas van Beek2021-10-123-52/+142
| | |
* | | Merge pull request #20104 from ShrirajHegde/mainCharles Harris2021-10-121-2/+1
|\ \ \ | |/ / |/| | MAINT: Update F2PY documentation URL
| * | MAINT: Update F2PY documentation URLShriraj Hegde2021-10-121-2/+1
|/ / | | | | | | http://cens.ioc.ee/projects/f2py2e/ is unavailable and links to NumPy and SciPy at https://web.archive.org/web/20140822061353/http://cens.ioc.ee:80/projects/f2py2e/ are too outdated.
* | Merge pull request #20088 from WarrenWeckesser/fix-gh-200077Charles Harris2021-10-112-20/+49
|\ \ | | | | | | BUG: core: result_type(0, np.timedelta64(4)) would seg. fault.
| * | MAINT: core: Rename the utility function used by PyArray_ResultTypewarren2021-10-111-8/+8
| | |
| * | DOC: core: Improve a comment by making it more specific.Warren Weckesser2021-10-111-1/+1
| | | | | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * | BUG: core: result_type(0, np.timedelta64(4)) would seg. fault.warren2021-10-102-20/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the line in convert_datatype.c result = PyArray_CastDescrToDType(all_descriptors[0], common_dtype); would trigger a seg. fault with a call such as np.result_type(0, np.timedelta64(4)) The problem was that `all_descriptors[0]` was NULL, and it was dereferenced in PyArray_CastDescrToDType. The code in the loop that followed the above line avoided passing NULL values in all_descriptors[i] to PyArray_CastDescrToDType by checking that the corresponding input argument to `result_type` was not a Python scalar. A different code path was taken in that case. The seg. fault is fixed by applying that same check to the first argument. Closes gh-20077.
* | | Merge pull request #20094 from ↵Charles Harris2021-10-112-1/+40
|\ \ \ | | | | | | | | | | | | | | | | Developer-Ecosystem-Engineering/as_avx-512f-log-overflow BUG: AVX-512F log() overflows
| * | | BUG: AVX-512F log() overflowsDeveloper-Ecosystem-Engineering2021-10-112-1/+40
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM has a bug with AVX-512F masked multiply intrinsic `_mm512_mask_mul_pd`. The multiply operation is performed unmasked with a masked store. This can cause FP exceptions for lanes that should be masked. LLVM bug report: https://bugs.llvm.org/show_bug.cgi?id=51988. The bug affects NumPy / SciPy because NumPy has an AVX-512F implementation for log(), which uses a masked multiply intrinsic: `_mm512_mask_mul_pd`. The bug surfaces in SciPy when trying to setup constants: ``` # The largest [in magnitude] usable floating value. _XMAX = np.finfo(float).max # The log of the largest usable floating value; useful for knowing # when exp(something) will overflow _LOGXMAX = np.log(_XMAX) ``` The workaround here explicitly masks the inputs before the multiply operation. **Testing** - Added a test case to numpy/core/tests/test_umath.py - Fails on trunk - Passes after workaround SciPy testing before: ``` 93 failed, 22378 passed, 1385 skipped, 93 xfailed, 7 xpassed, 1128 errors in 117.54s (0:01:57) ``` SciPy testing after: ``` 74 failed, 33361 passed, 2230 skipped, 108 xfailed, 8 xpassed in 178.19s (0:02:58) ``` Note, all `1128` errors have been resolved as well as less test failures (`93` --> `74`)
* | | Merge pull request #20097 from numpy/dependabot/pip/pycodestyle-2.8.0Charles Harris2021-10-111-1/+1
|\ \ \ | | | | | | | | MAINT: Bump pycodestyle from 2.7.0 to 2.8.0
| * | | MAINT: Bump pycodestyle from 2.7.0 to 2.8.0dependabot[bot]2021-10-111-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [pycodestyle](https://github.com/PyCQA/pycodestyle) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/PyCQA/pycodestyle/releases) - [Changelog](https://github.com/PyCQA/pycodestyle/blob/main/CHANGES.txt) - [Commits](https://github.com/PyCQA/pycodestyle/compare/2.7.0...2.8.0) --- updated-dependencies: - dependency-name: pycodestyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
* | | Merge pull request #20096 from numpy/dependabot/pip/hypothesis-6.23.2Charles Harris2021-10-111-1/+1
|\ \ \ | |/ / |/| | MAINT: Bump hypothesis from 6.23.1 to 6.23.2
| * | MAINT: Bump hypothesis from 6.23.1 to 6.23.2dependabot[bot]2021-10-111-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.23.1 to 6.23.2. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.23.1...hypothesis-python-6.23.2) --- updated-dependencies: - dependency-name: hypothesis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* | Merge pull request #20091 from johan12345/patch-1Matti Picus2021-10-111-1/+1
|\ \ | | | | | | DOC: fix typo in docstring of bitwise_or