summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | API: Raise EOFError when trying to load past the end of a `.npy` file (#23105)Noé Rubinstein2023-01-272-0/+15
| | |_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the following code: ``` import numpy as np with open('foo.npy', 'wb') as f: for i in range(np.random.randint(10)): np.save(f, 1) with open('foo.npy', 'rb') as f: while True: np.load(f) ``` Will raise: ``` ValueError: Cannot load file containing pickled data when allow_pickle=False ``` While there is no pickled data in the file.
| * | | | | | | | | | Merge pull request #22559 from richierocks/document_diag_indices_fromMatti Picus2023-01-261-0/+26
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DOC #22266 Add examples for diag_indices_from()
| | * \ \ \ \ \ \ \ \ \ Merge branch 'main' into document_diag_indices_fromRoss Barnowski2023-01-25312-6029/+10513
| | |\ \ \ \ \ \ \ \ \ \
| | * | | | | | | | | | | DOC: Fix example spacing and move to end of docstring.Ross Barnowski2023-01-251-11/+11
| | | | | | | | | | | | |
| | * | | | | | | | | | | Add examples for diag_indices_from()Richie Cotton2022-11-081-0/+26
| | | | | | | | | | | | |
| * | | | | | | | | | | | Merge pull request #23098 from ganesh-k13/bug_config_array_mesonSebastian Berg2023-01-261-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: Handle arrays in `conf_data`
| | * | | | | | | | | | | | BUG: Handle arrays in `conf_data`ganesh-k132023-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `configuration_data` does not support `lists` as the data argument * ref: https://mesonbuild.com/Reference-manual_functions.html#arguments12
| * | | | | | | | | | | | | Merge pull request #23045 from MikiPWata/doc/improve_nbytes_description-22925Matti Picus2023-01-261-0/+6
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / / / / / | |/| | | | | | | | | | | | DOC: Improved nbytes description
| | * | | | | | | | | | | | STY: rm newline.Ross Barnowski2023-01-251-2/+1
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | DOC: Improved nbytes description渡邉 美希2023-01-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DOC: Improved nbytes description DOC: Improved nbytes description DOC: Improved nbytes description
| * | | | | | | | | | | | | Merge pull request #23093 from seberg/f2py-error-handling-is-a-messCharles Harris2023-01-251-1/+8
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: Fixup f2py's handling a very little bit
| | * | | | | | | | | | | | | BUG: Fixup f2py's handling a very little bitSebastian Berg2023-01-251-1/+8
| | | |/ / / / / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This clears the error holding only to the type. Since in the other path the errmessage seemed completely uninitialized, I opted to just ignore it entirely and keep the old error. I could fathom to use error chaining here, but overall, I am not even sure that chaining makes even sense for these errors. This fix is meant to be minimal (the second one, I just noticed randomly), it does not make this code clean.
| * | | | | | | | | | | | | DOC, ENH: Improve docstring of real_if_close (#23087)Pieter Eendebak2023-01-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix docstring of real_if_close * factor out dtype
| * | | | | | | | | | | | | BUG: fix type in resolve_descriptors_function typedefNathan Goldbaum2023-01-251-1/+1
| | | | | | | | | | | | | |
| * | | | | | | | | | | | | Merge pull request #23077 from pradghos/fix_sin_cos_vxeSayed Adel2023-01-251-1/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / | |/| | | | | | | | | | | | BUG: Fix for npyv__trunc_s32_f32 (VXE)
| | * | | | | | | | | | | | replace __builtin_s390_vflls with npyv_doublee as beforePradipta Ghosh2023-01-241-2/+2
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | BUG: Fix for npyv_s32 npyv__trunc_s32_f32 (VXE)Pradipta Ghosh2023-01-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | np.sin(), np.cos() are giving erroneous result for float32 (VXE) This PR is fixing `npyv_s32 npyv__trunc_s32_f32(npyv_f32 a)` to resolve the issue.
| * | | | | | | | | | | | | Merge pull request #23079 from seberg/fix-int-truediv-promotionMatti Picus2023-01-252-28/+56
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: Fix `integer / float` scalar promotion
| | * | | | | | | | | | | | | TST: Explicitly ignore promotion issues for array**2 in hypothesis testSebastian Berg2023-01-241-1/+6
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | TST: Expand scalar/umath comparison tests especially for dtypesSebastian Berg2023-01-241-12/+42
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | BUG: Fix `integer / float` scalar promotionSebastian Berg2023-01-241-16/+9
| | |/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integer true division converted the other type directly to the output. This is correct if both operands are integers, but since the output of integer division is double precision, it is incorrect when the other operand is a float32 or float16. The solution is that we must convert to the same type (as always) and only the output type is adjusted, but not the inputs. This means that `integer / float` will correctly defer to the float which leads to correct promotion.
| * | | | | | | | | | | | | Merge pull request #21888 from WillTirone/fix_scipy_1339Matti Picus2023-01-251-2/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAINT: changing the method of checking for nan / inf values linalg.eig
| | * | | | | | | | | | | | | ENH: unifying error type for gh scipy #1339Will Tirone2023-01-242-6/+10
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | Changing error type in test for nan values in poly testWill Tirone2022-06-301-1/+1
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | MAINT: changing the method of checking for nan / inf values in numpy.linalg.eig.Will Tirone2022-06-291-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing numpy to use the same function from numpy.lib.function_base as scipy. Tests pass.
| * | | | | | | | | | | | | | BLD: Meson `__config__` generation (#22769)Ganesh Kathiresan2023-01-243-129/+251
| | |/ / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functionality to autogenerate build information for a Meson-based build. In order to add new information, do the following: - Add the information as an argument in `numpy/meson.build` - Modify `__config__.py.in` to accept the new argument Note that SIMD information is added to config, but is WIP/empty, because `__cpu*` lists are not yet populated as meson does not build SIMD features yet. There are two display modes: - `stdout`: Uses `PyYaml` to display in a human friendly format. Uses `json` if `PyYaml` is not installed - `dicts`: Returns a `dict` object Things will work fine without `pyyaml` installed, an unobtrusive warning is displayed that the printed output will look better with `pyyaml`. [ci skip]
| * | | | | | | | | | | | | ENH: Convert methods to vectorcall conversions (#23018)Pieter Eendebak2023-01-239-91/+159
| | |_|_|_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert several methods to the vectorcall convention. The conversions give a performance improvement, see #20790 (comment) Some notes: * For vdot the METH_KEYWORDS was removed, as the C vdot method was positional only. * The add_docstring is converted with an additional check. It was parsed as if (!PyArg_ParseTuple(args, "OO!:add_docstring", &obj, &PyUnicode_Type, &str)), but there is no support for the ! in the npy_parse_arguments * CI was complaining about coverage of _get_ndarray_c_version. A test was added, but only to provide coverage * In function_base.py a redundant check in def place was removed Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * | | | | | | | | | | | BUG: fix broken numpy.distutils Fortran handlingRalf Gommers2023-01-222-4/+10
| | |_|_|_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Path` and `COMMON_FIXED_EXTENSIONS` variables were not defined at all. This code is untested, and SciPy doesn't build with NumPy `main` before this fix. The issue was introduced a few days ago in gh-22885.
| * | | | | | | | | | | DEP: Remove the deprecated utils.py shim.Charles Harris2023-01-212-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The shim has been deprecated since 2019, the proper place to import utils funtions is directly from numpy.testing.
| * | | | | | | | | | | Merge pull request #20970 from seberg/reduce-identity-array-methMatti Picus2023-01-2113-129/+508
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | ENH: Move identity to the ArrayMethod to allow customization
| | * | | | | | | | | | | MAINT: Rename `initial` to `legacy_initial` in ArrayMethodSebastian Berg2023-01-202-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should only be used by the legacy method, so also reflect that in the field name.
| | * | | | | | | | | | | DOC: Adept code comments for clarity based on code reviewSebastian Berg2023-01-204-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
| | * | | | | | | | | | | MAINT: Prepend scaled float test statics with `sfloat_`Sebastian Berg2023-01-201-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As requested by Matti in review.
| | * | | | | | | | | | | MAINT: Address review comments by NathanSebastian Berg2023-01-203-23/+24
| | | | | | | | | | | | |
| | * | | | | | | | | | | MAINT: Rename PyUFunc_GetIDentity to PyUFunc_GetDefaultIdentitySebastian Berg2023-01-203-5/+6
| | | | | | | | | | | | |
| | * | | | | | | | | | | TST: Add test for wrapped ufuncs and reductions via ScaledFloatSebastian Berg2023-01-202-3/+104
| | | | | | | | | | | | |
| | * | | | | | | | | | | MAINT: Address many of Marten's commentsSebastian Berg2023-01-206-20/+39
| | | | | | | | | | | | |
| | * | | | | | | | | | | MAINT: Remove unneeded labelSebastian Berg2023-01-201-1/+0
| | | | | | | | | | | | |
| | * | | | | | | | | | | TST: Fix lint and ensure we have tests for empty arrays and reduceSebastian Berg2023-01-201-1/+14
| | | | | | | | | | | | |
| | * | | | | | | | | | | API: Bumpy experimental dtype api versionSebastian Berg2023-01-203-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its a new version (it changed ;)), plus I took the liberty to move things around a bit ABI wise.
| | * | | | | | | | | | | BUG: Fixup copying the wrong size in the cached path mostlySebastian Berg2023-01-202-8/+8
| | | | | | | | | | | | |
| | * | | | | | | | | | | MAINT: Rework things to make reorderability static and default to no initial ↵Sebastian Berg2023-01-207-185/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | value
| | * | | | | | | | | | | MAINT: Fixup names, and add workaround lost in rebaseSebastian Berg2023-01-201-6/+21
| | | | | | | | | | | | |
| | * | | | | | | | | | | MAINT: Rename arraymethod reduction identity getterSebastian Berg2023-01-205-57/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to look into whether to cut out the dynamic discovery of reorderability though.
| | * | | | | | | | | | | DOC,MAINT: Address "simple" review comments by MartenSebastian Berg2023-01-204-27/+32
| | | | | | | | | | | | |
| | * | | | | | | | | | | BUG: Fixup the default array-method, got the refcounting wrong...Sebastian Berg2023-01-201-5/+7
| | | | | | | | | | | | |
| | * | | | | | | | | | | ENH: Support identity-function in experimental DType APISebastian Berg2023-01-203-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add it to the wrapped array-method (ufunc) implementation so that a Unit dtype can reasonably use an identity for reductions.
| | * | | | | | | | | | | ENH: Move identity to the ArrayMethod to allow customizationSebastian Berg2023-01-206-92/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes/changes that the identity value is defined by the reduce dtype and not by the result dtype. That does not make a different in any sane use-case, but there is a theoretical change: arr = np.array([]) out = np.array(None) # object array np.add.reduce(arr, out=out, dtype=np.float64) Where the output result was previously an integer 0, due to the output being of `object` dtype, but now it is the correct float due to the _operation_ being done in `float64`, so that the output should be `np.zeros((), dtype=np.float64).astype(object)`.
| * | | | | | | | | | | | CI: musllinux_x86_64 (#22864)Andrew Nelson2023-01-203-3/+23
| |/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | | | | | Merge pull request #23034 from seberg/wrap-trapzRalf Gommers2023-01-202-0/+40
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | API: Allow SciPy to get away with assuming `trapz` is a Python function