summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | MAINT: simplify flow in np.requireKarl Otness2022-06-221-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the possible_flags dictionary to a global value so it is not re-constructed each call.
| * | | | | | | | | DOC: mention that np.require takes a sequence of requirementsKarl Otness2022-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document that other Python sequences are acceptable as arguments, not just lists.
* | | | | | | | | | Merge pull request #21798 from karlotness/maint-import-array-errCharles Harris2022-06-201-5/+8
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | MAINT: use PyErr_SetString in _import_array where possible
| * | | | | | | | | | MAINT: use PyErr_SetString in _import_array where possibleKarl Otness2022-06-201-5/+8
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update error messages in _import_array to avoid format string processing when not needed by the error message text.
* | | | | | | | | | Merge pull request #21789 from hoodmane/void-to-int-return-values-f2cCharles Harris2022-06-192-11/+12
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | ENH: Change f2c declarations with void return type to int
| * | | | | | | | | ENH: Change f2c declarations with void return type to intHood Chatham2022-06-172-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using f2c, the generated C functions for all of these actually return int. WebAssembly is strict on return types and will crash due to the discrepancy.
* | | | | | | | | | BUG: Fix comparison for empty structured arrays (#21796)Srimukh Sripada2022-06-192-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When empty structured arrays with nontrivially shaped fields are compared, the reshape operation invoked fails. Instead of reshaping using -1, computing the new dimension manually solves the problem. Fixes gh-21739
* | | | | | | | | | BUG: lib: A loadtxt error message had two values reversed.warren2022-06-182-6/+6
| |_|_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the reversed arguments to the call of PyErr_Format() that generates the exception for an invalid index in usecols. Also fix the format characters in several other calls of PyErr_Format() where the arguments are Py_ssize_t.
* | | | | | | | | ENH: add overflow handling for scalar `negative` operation (#21790)Meekail Zain2022-06-182-6/+20
| |_|_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related Issues/PRs Follow-up to #21648 Changes Adds check to scalar negative for determining whether an overflow warning should be raised for signed integers. Improves testing for negative operator on unsigned integers.
* | | | | | | | MAINT: fix up use of `NPY_NO_DEPRECATED_API` usage in f2pyRalf Gommers2022-06-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was giving a lot of warnings like: numpy/f2py/src/fortranobject.h:9: warning: "NPY_NO_DEPRECATED_API" redefined when building SciPy. In general, this is generated code which is included in the build of other projects which may have already set this macro - so only set it if it is not yet set. The other change is to set it to the current numpy version, like is done everywhere else in numpy, rather than to a fixed 1.7 version. This will ensure that if new deprecations happen, f2py gets updated for them.
* | | | | | | | Merge pull request #21779 from ↵Charles Harris2022-06-162-0/+11
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WarrenWeckesser/hameerabbasi-disallow-complex-gaussian MAINT: random: Disallow complex inputs in multivariate_normal
| * | | | | | | | MAINT: random: Update to disallowing complex inputs to multivariate_normal.warren2022-06-162-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disallow both mean and cov from being complex. * Raise a TypeError instead of a NotImplementedError if mean or cov is complex. * Expand and fix the unit test.
| * | | | | | | | MAINT: random: Disallow complex covariances in multivariate_normalHameer Abbasi2022-06-162-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit disallows complex covariances in multivariate_normal as passing them can silently lead to incorrect results.
* | | | | | | | | MAINT, SIMD: remove orphan path vsx/conversion.hSayed Adel2022-06-161-146/+0
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This path was left behind by mistake, VSX and ZVEC are combined inside one path /vec
* | | | | | | | MAINT: fix typo in string_ufuncs.cpp (#21773)Ikko Ashimine2022-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | recieve -> receive inline comment
* | | | | | | | Merge pull request #21771 from WarrenWeckesser/readtxt-check-callocSebastian Berg2022-06-151-0/+4
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | MAINT: Add a check of the return value of PyMem_Calloc().
| * | | | | | | MAINT: Add a check of the return value of PyMem_Calloc().warren2022-06-151-0/+4
| | | | | | | |
* | | | | | | | MAINT: Fix computation of numpy.array_api.linalg.vector_norm (#21084)Aaron Meurer2022-06-151-8/+31
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix computation of numpy.array_api.linalg.vector_norm Various pieces were incorrect due to a lack of complete coverage of this function in the array API test suite. * Fix the output dtype nonstandard vector norm() Previously it would always give float64 because an internal calculation involved a NumPy scalar and a Python float. The fix is to use a 0-D array instead of a NumPy scalar so that it type promotes with the float correctly. Fixes #21083 I don't have a test for this yet because I'm unclear how exactly to test it. * Clean up the numpy.array_api.linalg.vector_norm code a little bit
* | | | | | | Fix a potential variable misuse bugJingxuan He2022-06-151-1/+1
| | | | | | |
* | | | | | | MAINT: use f-string format in test_abc.py (#21763)Vardhaman2022-06-151-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed f-string format Changed f-string format for the clear and clean understanding of code. * Update test_abc.py
* | | | | | | MAINT: remove some names from main numpy namespace (#21403)Ross Barnowski2022-06-152-3/+12
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | A small step towards numpy namespace cleanup. Removes a few names from `__dir__` so that they are less discoverable when using numpy interactively, e.g. in IPython or notebooks.
* | | | | | TST: Clean up an opened temporary file descriptor in loadtxt testsSebastian Berg2022-06-141-0/+5
| | | | | |
* | | | | | BUG: Decref `loadtxt` converters when doneSebastian Berg2022-06-141-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Possibly they were just not incref'd in an earlier version of the code. But incref'ing seems right, so this adds the proper decref loop.
* | | | | | BUG: Fix DECREF when `__array_priority__` is None (or similar)Sebastian Berg2022-06-141-1/+1
| | | | | |
* | | | | | Merge pull request #21755 from seberg/fix-pyint-result-typeCharles Harris2022-06-142-1/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: Do not skip value-based promotion path for large Python integers
| * | | | | | BUG: Do not skip value-based promotion path for large Python integersSebastian Berg2022-06-142-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have: 1. Only Python scalars (int, float, complex) as inputs 2. One of the integers is too large for the default integer dtype The "new" promotion path (which existed for a long time internally!) would not produce the same result as the legacy value-based path. However, my logic failed to check for the second part, so it did not run the legacy path in this odd little case. This fixes the issue reported in: https://github.com/numpy/numpy/issues/13754#issuecomment-1155126639
* | | | | | | Merge pull request #21732 from hoodmane/fenv-missing-flagsSebastian Berg2022-06-142-0/+48
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | ENH: Add support for platforms with missing fenv flags
| * | | | | | | MAINT: Simplify FE_INVALID redefine logic slightly and copy to cppSebastian Berg2022-06-142-48/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds on the previous, but just redefines them in the C/C++ file since this is not a header and defining an undefined macro value should not be a problem locally. Also tweaks the comment a bit.
| * | | | | | | ENH: Add support for platforms with missing fenv flagsHood Chatham2022-06-141-12/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For instance wasm has no fenv support. musl-libc defines all the fenv functions unconditionally (fesetexcept, feclearexcept, etc) but on unsupported platforms they are no-ops: https://git.musl-libc.org/cgit/musl/tree/src/fenv/fenv.c However, the platform is expected to only define flags like FE_OVERFLOW if they are supported. I haven't found an explanation of the design decision, but it seems to be aimed at fine-grained feature detection. musl-libc-test has code that uses fenv and wants it to silently decay to a no-op on platforms missing support. I copied their implementation of this behavior: http://nsz.repo.hu/git/?p=libc-test;a=blob;f=src/common/mtest.h;h=706c1ba23ea8989b17a2f72ed1a919e187c06b6a;hb=HEAD#l30
* | | | | | | | MAINT: limit the number of decimals in Polynomial representation (#21654)Lev Maximov2022-06-146-52/+167
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * limit the number of decimals in Polynomial representation * tests pass * parenthesize exponential notation in polynomials * fixed a long line warning * added polynomial printoptions tests * polynomial printoptions typo fixed * made switch to exp notation in polynomial display more natural * added a test on switching polynomials to exp notation * fixed linter errors/warnings * support for nanstr and infstr printoptions in polynomials * 10^8 threshold for switching to exp notation when displaying polynomials * merged in PR #21696 fixing issue #21695 * made linter happy * made some docstring tests pass * fixed the docs Co-authored-by: Lev Maximov <lev.maximov@gmail.com>
* | | | | | | Merge pull request #21567 from bsipocz/doctest_enable_in_pytesttesterCharles Harris2022-06-141-3/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | BUG: Adding the default pytest doctest instead of the ValueError
| * | | | | | | BUG: Adding the default pytest doctest runner instead of the ValueError to ↵Brigitta Sipőcz2022-05-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the np testrunner
* | | | | | | | Merge pull request #21749 from seiko2plus/issue_21747Matti Picus2022-06-141-1/+1
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | BUG, SIMD: Fix detecting NEON/ASIMD on aarch64
| * | | | | | | BUG, SIMD: Fix detecting NEON/ASIMD on aarch64Sayed Adel2022-06-141-1/+1
| | | | | | | |
* | | | | | | | Merge pull request #21748 from pradghos/s390x_numpy_fixSayed Adel2022-06-141-2/+7
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | BUG: Fix for npyv_orc_b8 and npyv_xnor_b8 for s390x (z13)
| * | | | | | | addressed review commentsPradipta Ghosh2022-06-131-4/+4
| | | | | | | |
| * | | | | | | Fix for npyv_orc_b8 and npyv_xnor_b8 for s390x(z13)Pradipta Ghosh2022-06-131-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement npyv_orc_b8 and npyv_xnor_b8 for z13. '__builtin_s390_vec_orc' and `__builtin_s390_vec_eqv` require z14 or higher.
* | | | | | | | Merge pull request #21437 from seberg/fpe-in-castMatti Picus2022-06-1427-239/+832
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | ENH: Add floating point error checking to (almost) all casts
| * | | | | | | | TST: Remove FPE `fill` special case after rebaseSebastian Berg2022-06-131-10/+5
| | | | | | | | |
| * | | | | | | | TST: Add final set of cast (and FPE in cast) test to ufuncsSebastian Berg2022-06-131-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The remaining uncovered paths seem to me like code that should be effectively unreachable. (I do actually wonder if `PyArray_MapIterReset` should be removed.)
| * | | | | | | | TST: Enable inteer array assignment test and add flat testSebastian Berg2022-06-131-1/+7
| | | | | | | | |
| * | | | | | | | BUG: Avoid `NpyIter_EnableExternalLoop` as it resets the bufferSebastian Berg2022-06-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resetting the buffer will copy it, which may cause casting errors. And we want to prefer/catch those later ideally.
| * | | | | | | | TST: Improve test coverage for complex FPE cast errorsSebastian Berg2022-06-131-0/+6
| | | | | | | | |
| * | | | | | | | TST: Add type check to not trigger an invalid FPE within PyPySebastian Berg2022-06-131-2/+4
| | | | | | | | |
| * | | | | | | | BUG: Add volatile to float -> datetime casts to work around compiler ↵Sebastian Berg2022-06-131-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deficiencies
| * | | | | | | | BUG: Fix needs_api for avanced assignments without subspace and remove ↵Sebastian Berg2022-06-132-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unnecessary delay The delay is not necessary, because the iterator does not cast in any case, so we do not actually care about the possibility of errors being raised.
| * | | | | | | | TST: Fixup test name and check for ppc64leSebastian Berg2022-06-131-2/+6
| | | | | | | | |
| * | | | | | | | TST: Fix the weird boolean+advanced indexing testSebastian Berg2022-06-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test meant to assert shapes, but didn't actually do it.
| * | | | | | | | BUG: Fix invalid access due to `iter` already being cleaned upSebastian Berg2022-06-131-2/+2
| | | | | | | | |
| * | | | | | | | ENH: Add floating point error handling to advanced indexingSebastian Berg2022-06-135-77/+142
| | | | | | | | |