summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | | | | | MAINT: Simplify reference counting in the np.array() internal codeSebastian Berg2023-03-201-54/+35
| | | | | | | | | | | |
| | * | | | | | | | | | MAINT: respond to review commentsNathan Goldbaum2023-03-202-17/+27
| | | | | | | | | | | |
| | * | | | | | | | | | MAINT: move npy_dtype_info definition back to descriptor.hNathan Goldbaum2023-03-208-18/+13
| | | | | | | | | | | |
| | * | | | | | | | | | MAINT: avoid calling PyArray_AdaptDescriptorToArray in some casesNathan Goldbaum2023-03-171-4/+26
| | | | | | | | | | | |
| | * | | | | | | | | | MAINT: Indicate private functions with _int suffix.Nathan Goldbaum2023-03-173-35/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also make internal versions accept a dtype and a descriptor.
| | * | | | | | | | | | BUG: handle errors from PyArray_AdaptDescriptorToArrayNathan Goldbaum2023-03-171-0/+5
| | | | | | | | | | | |
| | * | | | | | | | | | ENH: allow using dtype classes in array creation functionsNathan Goldbaum2023-03-1715-70/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables writing np.array(some_object, dtype=type(np.dtype('i'))). This is a follow-on from https://github.com/numpy/numpy/pull/23154, see that PR for more details. I had to add a new include to `ctors.h` to bring in the definition of the `npy_dtype_info` struct. Since `ctors.h` is included in many other files inside numpy, I found that I needed to modify fewer includes across numpy if I moved the definition of `npy_dtype_info` to `common.h` from `descriptor.h`. The new includes of `common.h` are needed to support later includes of `ctors.h` in those files. If anyone has an alternate place to put `npy_dtype_info` that would cause less churn of includes I'd love to hear about it. I spent a bunch of time tweaking the reference counts. I'm reasonably confident this is correct but not 100%, an additional careful pass over the reference count logic from a reviewer would be very appreciated. I could have made `_PyArray_FromAny` and `_PyArray_CheckFromAny` take just a `npy_dtype_info` struct, but I found it made the reference count logic more complicated, since `PyArray_FromAny` and `PyArray_CheckFromAny` steal the reference to the descriptor they are passed and I needed to conserve that behavior. Also both functions support passing in a `NULL` pointer for the descriptor and I needed to maintain that behavior as well. The change to `ucsnarrow.h` fixes a preexisting conflict with the prototype in `ucsnarrow.c` that triggered a compiler error while I was working on this.
| * | | | | | | | | | | Merge pull request #23240 from byrdie/bugfix/ufunc_where_propagationSebastian Berg2023-03-228-11/+119
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / / / | |/| | | | | | | | | | ENH: Allow ``where`` argument to override ``__array_ufunc__``
| | * | | | | | | | | | ENH: Modified `PyUFunc_CheckOverride` to allow the `where` argument to ↵Roy Smart2023-02-248-11/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | override `__array_ufunc__`.
| * | | | | | | | | | | MAINT: Fix 'paramteric' typoChristian Veenhuis2023-03-211-8/+8
| | | | | | | | | | | |
| * | | | | | | | | | | BUG: Fix busday_count for reversed dates (#23229)Pieter Eendebak2023-03-202-3/+26
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | Fixes #23197
| * | | | | | | | | | Merge pull request #23403 from mattip/clip-cleanupSebastian Berg2023-03-162-112/+20
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DEP: remove deprecated casting in np.clip
| | * | | | | | | | | | DEP: remove deprecated casting in np.clipMatti Picus2023-03-162-112/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matti Picus <matti.picus@gmail.com>
| * | | | | | | | | | | DOC: fix extra space in error messageBerke Kocaoğlu2023-03-161-1/+1
| |/ / / / / / / / / /
| * | | | | | | | | | Merge pull request #23384 from neutrinoceros/cleanup_py38Sebastian Berg2023-03-147-56/+21
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | MAINT: cleanup unused Python3.8-only code and references
| | * | | | | | | | | | MAINT: cleanup unused Python3.8-only code and referencesClément Robert2023-03-147-56/+21
| | | | | | | | | | | |
| * | | | | | | | | | | ENH: show dtype in array repr when endianness is non-native (#23295)molsonkiko2023-03-142-1/+51
| |/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fx problem where, for example, np.array([1], dtype='>u2') and np.array([1], dtype='<u2') both got represented as np.array([1], dtype=uint16), or the dtype is not shown for the default ones (float64, default int).
| * | | | | | | | | | Merge pull request #23378 from seberg/doc-fixup-spawnMatti Picus2023-03-142-0/+12
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DOC: Add `n_children` param to rng.spawn() and bitgen.spawn() docs
| | * | | | | | | | | | DOC: Add `n_children` param to rng.spawn() and bitgen.spawn() docsSebastian Berg2023-03-142-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original PR forgot to include the Parameters section (and thus the paraeter itself).
| * | | | | | | | | | | Merge pull request #23361 from kawakami-k/fccCharles Harris2023-03-131-1/+30
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | BLD: add SSL2 default path for Fujitsu C/C++ compiler
| | * | | | | | | | | | | BLD: add SSL2 default path for Fujitsu C/C++ compilerKentaro Kawakami2023-03-091-1/+30
| | | |_|_|_|_|_|_|/ / / | | |/| | | | | | | | |
| * | | | | | | | | | | Merge pull request #23380 from r-devulap/x86simdCharles Harris2023-03-131-0/+0
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / | |/| | | | | | | | | | MAINT: Update x86-simd-sort to latest commit
| | * | | | | | | | | | update x86-simd-sort to latest commitRaghuveer Devulapalli2023-03-131-0/+0
| | | | | | | | | | | |
| * | | | | | | | | | | MAINT: remove `NUMPY_EXPERIMENTAL_ARRAY_FUNCTION` env varRalf Gommers2023-03-128-99/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in https://mail.python.org/archives/list/numpy-discussion@python.org/thread/UKZJACAP5FUG7KP2AQDPE4P5ADNWLOHZ/ This flag was always meant to be temporary, and cleaning it up is long overdue.
| * | | | | | | | | | | DEP: expire deprecation for "y as out" in fix/isposinf/isneginfRalf Gommers2023-03-122-65/+1
| | | | | | | | | | | |
| * | | | | | | | | | | BLD: Check for submodules before build (#23372)Raghuveer Devulapalli2023-03-122-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - DOC: update git clone command in doc to initialize submodules - BLD: Check for submodules before building - CI: update meson.build check and Cirrus for new git submodule [skip ci] Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
| * | | | | | | | | | | DEP: update deprecations for `np.product` and co to emit from dispatcherRalf Gommers2023-03-101-25/+68
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on a review comment on gh-23314 [skip cirrus] [skip circle]
| * | | | | | | | | | Merge pull request #23337 from peytondmurray/argminmax-nep42-dtype-supportSebastian Berg2023-03-081-6/+11
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | ENH: Add support for argmin and argmax for NEP42 dtypes
| | * | | | | | | | | | ENH: Add support for argmin and argmax for NEP42 dtypespdmurray2023-03-071-6/+11
| | | | | | | | | | | |
| * | | | | | | | | | | DOC: Add 'may vary' markup in info() docstring.warren2023-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip actions] [skip travis] [skip cirrus]
| * | | | | | | | | | | DOC: Edit top line of info() docstring to mention array.warren2023-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip actions] [skip travis] [skip azp] [skip cirrus]
| * | | | | | | | | | | DOC: Document that info() handles array instances.warren2023-03-071-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip actions] [skip travis] [skip azp] [skip cirrus]
| * | | | | | | | | | | DOC: Clearer docstring for repeat (#23348)Pierre2023-03-071-1/+1
| | |/ / / / / / / / / | |/| | | | | | | | |
| * | | | | | | | | | Merge pull request #23335 from tylerjereddy/treddy_issue_22041Marten van Kerkwijk2023-03-062-1/+7
| |\ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / / / | |/| | | | | | | | | BUG: ma with structured dtype
| | * | | | | | | | | BUG: ma with structured dtypeTyler Reddy2023-03-032-1/+7
| | |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #22041 * add regression test and fix for creating a masked array with a structured dtype; the test is simply for lack of error in the repoducer * the concern expressed by core team in matching issue was that `astropy` might be negatively affected; I ran full `astropy` (hash: `c9ad7c56`) test suite locally with this feature branch and it seemed "ok," just 1 unrelated network failure in the network-requiring tests (`test_ftp_tls_auto`): ```1 failed, 21430 passed, 3490 skipped, 176 xfailed, 23275 warnings in 430.18s (0:07:10)```
| * | | | | | | | | Merge pull request #22982 from yamadafuyuka/add_fujitsuccompiler_and_SSL2Sebastian Berg2023-03-0611-12/+121
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.
| | * | | | | | | | | ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.yamadafuyuka2023-03-0211-12/+121
| | | | | | | | | | |
| * | | | | | | | | | Merge pull request #23326 from hawkinsp/clipwrapCharles Harris2023-03-051-4/+0
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | TYP: Remove duplicate CLIP/WRAP/RAISE in __init__.pyi.
| | * | | | | | | | | | Remove duplicate CLIP/WRAP/RAISE in __init__.pyi.Peter Hawkins2023-03-051-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These constants are defined twice in this file, to which pytype objects.
| * | | | | | | | | | | Merge pull request #23340 from BvB93/msortCharles Harris2023-03-052-2/+0
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | TYP: Remove two stray type-check-only re-exports of `msort`
| | * | | | | | | | | | | TYP: Remove some stray type-check-only imports of `msort`BvB932023-03-052-2/+0
| | |/ / / / / / / / / /
| * | | | | | | | | | | Merge pull request #23103 from SimonAltrogge/typing-fixBas van Beek2023-03-051-28/+70
| |\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / | |/| | | | | | | | | | TYP: Fix return type to float on _FloatLike_co arguments
| | * | | | | | | | | | TYP: Update even more `_generator` argument types to `_FloatLike_co`BvB932023-03-051-27/+68
| | | | | | | | | | | |
| | * | | | | | | | | | TYP: Fix return type to float on _FloatLike_co argumentsSimonAltrogge2023-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, `rng.exponential(scale=np.sum(np.arange(10.0)))` indicates its return value as `np.ndarray[Any, dtype[float64]]` even though a `float` is returned on `_FloatLike_co` values of the `scale` argument. This commit fixes this problem such that `rng.exponential` indicates the correct return type on `_FloatLike_co` inputs.
| * | | | | | | | | | | Merge pull request #23325 from hawkinsp/reduceatBas van Beek2023-03-051-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | TYP: Replace duplicate reduce in ufunc type signature with reduceat.
| | * | | | | | | | | | | Replace duplicate reduce in ufunc type signature with reduceat.Peter Hawkins2023-03-031-1/+1
| | | |_|/ / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presumably this is a typo: ufuncs have both reduce and reduceat.
| * | | | | | | | | | | Merge pull request #23328 from hawkinsp/macompBas van Beek2023-03-051-0/+4
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | TYP: Add type annotations for comparison operators to MaskedArray.
| | * | | | | | | | | | | Add type annotations for comparison operators to MaskedArray.Peter Hawkins2023-03-031-0/+4
| | |/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comparison operators seem to be missing annotations; whereas pretty much every other operator is annotated. This causes pytype to conclude that the output of, say, __gt__ is a regular ndarray, which isn't true.
| * | | | | | | | | | | Mark `d` argument to fftfreq and rfftfreq as optional in type stubs.Peter Hawkins2023-03-031-4/+4
| |/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type stubs incorrectly mark this argument as mandatory.
| * | | | | | | | | | Merge pull request #23317 from larrybradley/fix-typosMatti Picus2023-03-031-5/+5
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DOC: fix typos