summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | | | | | BLD: enable building NumPy with MesonRalf Gommers2022-11-2525-12/+2089
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables building with NumPy on Linux and macOS. Windows support should be complete to, but is untested as of now and may need a few tweaks. This contains: - A set of `meson.build` files and related code generation script tweaks, header templates, etc. - One CI job on Linux - Basic docs on using Meson to build NumPy (not yet integrated in the html docs, it's too early for that - this is for early adopters right now). The build should be complete, with the major exception of SIMD support. The full test suite passes. See gh-22546 for the tracking issue with detailed notes on the plan for switching NumPy to Meson as its build system. Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
| | * | | | | | | | | | MAINT: avoid gcc warning that signed and unsigned types are being comparedStefan van der Walt2022-11-251-1/+1
| | | | | | | | | | | |
| | * | | | | | | | | | BLD: fix missing `Python.h` includesRalf Gommers2022-11-255-5/+16
| | | |_|_|_|/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Python.h` must be included before including and standard library headers, if it's pulled in (which happens when you include numpy headers). Otherwise we see build warnings like: ``` 142/244] Compiling C object numpy/core/_multiarray_umath.cpython-311-x86_64-linux-gnu.so.p/src_multiarray_textreading_field_types.c.o In file included from /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/Python.h:86, from ../numpy/core/include/numpy/npy_common.h:5, from ../numpy/core/include/numpy/ndarraytypes.h:4, from ../numpy/core/src/multiarray/textreading/field_types.h:9, from ../numpy/core/src/multiarray/textreading/field_types.c:1: /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts); | ^~~~~~~~ /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); | ^~~~~~~~ /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts); | ^~~~~~~~ ```
| * | | | | | | | | | Merge pull request #22674 from rgommers/npy-inline-cleanupRalf Gommers2022-11-2570-378/+353
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAINT: replace `NPY_INLINE` with `inline` [ci skip]
| | * | | | | | | | | | MAINT: replace `NPY_INLINE` with `inline`Ralf Gommers2022-11-2570-378/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes gh-22100
| * | | | | | | | | | | Merge pull request #22666 from mattip/drop-sixSebastian Berg2022-11-251-2/+0
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / | |/| | | | | | | | | | MAINT: remove 'six' dependency from pyinstaller
| | * | | | | | | | | | remove 'six' dependency from pyinstallermattip2022-11-241-2/+0
| | | | | | | | | | | |
| * | | | | | | | | | | MAINT: lib: A bit of flake8-driven clean up in shape_base.pywarren2022-11-241-4/+4
| | | | | | | | | | | |
| * | | | | | | | | | | DOC: lib: Use keepdims in a couple docstrings.warren2022-11-241-7/+9
| |/ / / / / / / / / /
| * | | | | | | | | | DOC: Update mode parameter description to account for shape #22643 (#22655)mkiffer2022-11-231-1/+2
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `shape` parameter must be specified when opened in appending mode. Docstring and exception message wording are updated to reflect this. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
| * | | | | | | | | Merge pull request #22653 from ngoldbaum/ensure-canonical-checkSebastian Berg2022-11-231-0/+6
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | MAINT: check user-defined dtype has an ensure_canonical implementation
| | * | | | | | | | | [MAINT] check user-defined dtype has an ensure_canonical implementationNathan Goldbaum2022-11-221-0/+6
| | | | | | | | | | |
| * | | | | | | | | | Merge pull request #22646 from hawkinsp/odrSebastian Berg2022-11-228-52/+52
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | MAINT: Rename symbols in textreading/ that may clash when statically linked
| | * | | | | | | | | Rename symbols in textreading/ that may clash when statically linked.Peter Hawkins2022-11-228-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it is not the standard way NumPy is built, some users build and link NumPy statically together with other modules. In this case generic names like `tokenize` or `to_float` can clash with similar symbols from other modules. We can defend against this either by using a C++ namespace or by prefixing symbols likely to clash with a prefix like npy_.
| * | | | | | | | | | Merge pull request #22638 from seberg/machar-deprCharles Harris2022-11-224-32/+9
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DEP: Finalize MachAr and machar deprecations
| | * | | | | | | | | | DEP: Finalize MachAr and machar deprecationsSebastian Berg2022-11-224-32/+9
| | | |_|/ / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the attributes on finfo and the "public" module. It also deprecates `np.core.MachAr`. We should be able to get away with just deleting it, but there seems little reason to not just deprecate it for now.
| * | | | | | | | | | REL: Prepare main for NumPy 1.25.0 developmentCharles Harris2022-11-222-0/+2
| | |/ / / / / / / / | |/| | | | | | | |
| * | | | | | | | | ENH: raise TypeError when arange() is called with string dtype (#22087)Daniel da Silva2022-11-213-61/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: raise TypeError when arange() is called with string dtype * Add release note for dtype=str change to arange() * DOC: Minor wording/formatting touchups to release note. * Update numpy/core/tests/test_multiarray.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Move check to PyArray_ArangeObj * remove old code * BUG,MAINT: Clean out arange string error and other paths * BUGS: Fixup and cleanup arange code a bit * DOC: Update release note to new message * BUG: Fix refcounting and simplify arange * MAINT: Use SETREF to make arange dtype discovery more compact * MAINT: Update numpy/core/src/multiarray/ctors.c Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Sebastian Berg <sebastianb@nvidia.com> Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
| * | | | | | | | | Merge pull request #22316 from seberg/void-strctured-newSebastian Berg2022-11-216-20/+154
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | ENH: Allow creating structured void scalars by passing dtype
| | * | | | | | | | | DOC: Update np.void docs based on Matti's commentsSebastian Berg2022-11-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
| | * | | | | | | | | ENH: Allow creating structured void scalars by passing dtypeSebastian Berg2022-09-216-20/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an optional `dtype=` kwarg to `np.void`. If given (and not None), this kwarg effectively turns it into: res = np.array(data, dtype=dtype)[()] Thanks for Marten's review and Bas' help with the typing. Reviewed-by: Marten van Kerkwijk <mhvk@astro.utoronto.ca> Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
| * | | | | | | | | | Merge pull request #22436 from cmarmo/doc-masked-equalSebastian Berg2022-11-211-17/+11
| |\ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / | |/| | | | | | | | | DOC: Clarify docstring of `masked_equal` and `masked_values`
| | * | | | | | | | | Update numpy/ma/core.pySebastian Berg2022-11-211-3/+1
| | | | | | | | | | |
| | * | | | | | | | | Address reviewer comment.Chiara Marmo2022-10-171-2/+4
| | | | | | | | | | |
| | * | | | | | | | | Clarify docstring of masked_valuesChiara Marmo2022-10-131-14/+8
| | | | | | | | | | |
| * | | | | | | | | | Merge pull request #22607 from seberg/scalar-aliasesRalf Gommers2022-11-218-115/+67
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | DEP: Next step in scalar type alias deprecations/futurewarnings
| | * | | | | | | | | | DOC: Adjust comments on deprecated/future scalar alias based on reviewSebastian Berg2022-11-211-3/+5
| | | | | | | | | | | |
| | * | | | | | | | | | BUG: Fixup warning giving and remove MachAr from docsSebastian Berg2022-11-172-3/+4
| | | | | | | | | | | |
| | * | | | | | | | | | TYP: Remove newly deprecated scalar type aliasesSebastian Berg2022-11-173-25/+0
| | | | | | | | | | | |
| | * | | | | | | | | | DEP: Next step in scalar type alias deprecations/futurewarningsSebastian Berg2022-11-175-90/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finalizes the scalar type alias deprecations making them an error. However, at the same time adds a `FutureWarning` that new aliases will be introduced in the future. (They would eventually be preferred over the `str_`, etc. version.) It may make sense, that this FutureWarning is already propelled soon since it interacts with things such as changing the representation of strings to `np.str_("")` if the preferred alias becomes `np.str`. It also introduces a new deprecation to remove the 0 sized bit-aliases and the bitsize `bool8` alias. (Unfortunately, these are here still allowed as part of the `np.sctypeDict`).
| * | | | | | | | | | | DOC: Add example for np.ma.power as part of #22269Stefanie Molin2022-11-191-0/+26
| | | | | | | | | | | |
| * | | | | | | | | | | DOC: testing: Fix typo: nulps -> nulpwarren2022-11-181-1/+1
| | |_|_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip actions] [skip travis] [skip azp]
| * | | | | | | | | | BUG: Histogramdd breaks on big arrays in Windows (#22561)Navpreet Singh2022-11-182-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUG: Histogramdd breaks on big arrays in Windows Resolved the issue with line change from int to np.intp in numpy/numpy/lib/histograms.py * BUG: Histogramdd breaks on big arrays in Windows Resolved the issue with line change from int to np.intp in numpy/numpy/lib/histograms.py * Removed the binary files * Update test_histograms.py * Update test_histograms.py * Update test_histograms.py
| * | | | | | | | | | TST: Rename setup to setup_method in _locales (#22616)Stefan van der Walt2022-11-171-2/+2
| | | | | | | | | | |
| * | | | | | | | | | MAINT: remove macOS specific long double handling in numpyconfig.hRalf Gommers2022-11-171-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was put in place for universal builds (the old kind, PPC/Intel), and then extended for arm64 support. It was only needed when building for two architectures in a single build. We no longer support i386/PPC/universal, and for producing universal2 wheels for those users that want that, the way to do it is to take a x86-64 wheel and an arm64 wheel and fuse those with the `delocate-fuse` utility from `delocate`. Hence this code is no longer needed.
| * | | | | | | | | | BLD: update OpenBLAS to 0.3.21 and clean up openblas download test (#22525)Matti Picus2022-11-172-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUILD: update OpenBLAS to 0.3.21 and clean up openblas download test * set LDFLAGS on windows64 like the openblaslib build does * use rtools compilers on windows when building wheels * fix typos * add rtools gfortran to PATH * use the openblas dll from the zip archive without rewrapping * typos * copy dll import library for 64-bit interfaces * revert many of the changes to azure-steps-windows.yaml, copy openblas better in wheels * fix wildcard copy * test OpenBLAS build worked with threadpoolctl * typos * install threadpoolctl where needed, use for loop to recursively copy * update macos OpenBLAS suffixes for newer gfortran hashes * use libgfortran5.dylib on macos * fix scripts * re-use gfortran install from MacPython/gfortran-install on macos * use pre-release version of delocate * fixes for wheel builds/tests * add debugging cruft for pypy+win, macos wheels * add DYLD_LIBRARY_PATH on macosx-x86_64 * use 32-bit openblas interfaces for ppc64le tests * skip large_archive test that sometimes segfaults on PyPy+windows
| * | | | | | | | | | Merge pull request #22605 from seberg/silence-update-shape-warningCharles Harris2022-11-171-2/+2
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | MAINT: (array-coercion) Silence invalid read warning in some gcc versions
| | * | | | | | | | | MAINT: (array-coercion) Silence invalid read warning in some gcc versionsSebastian Berg2022-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warnings are harmless and seem to be caused by the "hint" that the shape cannot be larger than that area. But some compiler versions seem to check that the function call is always correct based on the signature. That probably makes sense, so just remove that "size hint" which is maybe even technically incorrect (the compiler is not allowed to read more as an optimization).
| * | | | | | | | | | Merge pull request #22601 from seberg/issue-22599Charles Harris2022-11-161-9/+9
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | MAINT: Use C99 flexible struct construct for `NpyIter_InternalOnly`
| | * | | | | | | | | MAINT: Use C99 flexible struct construct for `NpyIter_InternalOnly`Sebastian Berg2022-11-161-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the allocation size by 1 byte, but that doesn't matter (everything we store later is larger anyway and the 1 doesn't seem to be accounted for in `NIT_SIZEOF_ITERATOR`). This should fix certain compiler warnings and because of that: Closes gh-22599
| * | | | | | | | | | Merge pull request #22422 from seberg/expose-dtype-resolution-get-loopMatti Picus2022-11-163-40/+750
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | ENH: Expose `ufunc.resolve_dtypes` and strided loop access
| | * | | | | | | | | | MAINT: Adopt changes from Stuart's reviewSebastian Berg2022-10-272-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
| | * | | | | | | | | | DOC: Add comment for capsule which includes name (mainly to point to docs)Sebastian Berg2022-10-271-0/+6
| | | | | | | | | | | |
| | * | | | | | | | | | BUG: Fix `_resolve_dtypes_and_context` refcounting error returnsSebastian Berg2022-10-271-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reusing `result` doesn't work with a single "finish" goto, since result must be NULL on error then. This copies the result over for continuation, which is maybe also a bit awkward, but at least not buggy...
| | * | | | | | | | | | BUG: Fix error checking of _get_strided_Loop fixed_stridesSebastian Berg2022-10-272-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add tests (including for a bad capsule)
| | * | | | | | | | | | DOC: Apply Stuarts suggestions from code reviewSebastian Berg2022-10-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
| | * | | | | | | | | | DOC: Add examples for ufunc.resolve_dtypesSebastian Berg2022-10-251-0/+25
| | | | | | | | | | | |
| | * | | | | | | | | | TST: Skip ufunc loop access if `ctypes.pythonapi` is unavailableSebastian Berg2022-10-121-2/+3
| | | | | | | | | | | |
| | * | | | | | | | | | BUG: `ufunc.resolve_dtypes` expects descrs to be valid even on errorSebastian Berg2022-10-121-1/+1
| | | | | | | | | | | |
| | * | | | | | | | | | ENH: Allow reductions in `np.add.resolve_dtypes`Sebastian Berg2022-10-123-25/+76
| | | | | | | | | | | |