Skip to content

Commit

Permalink
Update dependency numpy to v2 (#109)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [numpy](https://numpy.org)
([source](https://redirect.github.com/numpy/numpy),
[changelog](https://numpy.org/doc/stable/release)) | `==1.26.4` ->
`==2.1.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/numpy/2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/numpy/2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/numpy/1.26.4/2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/numpy/1.26.4/2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>numpy/numpy (numpy)</summary>

###
[`v2.1.1`](https://redirect.github.com/numpy/numpy/compare/v2.1.0...v2.1.1)

[Compare
Source](https://redirect.github.com/numpy/numpy/compare/v2.1.0...v2.1.1)

###
[`v2.1.0`](https://redirect.github.com/numpy/numpy/compare/v2.0.1...v2.1.0)

[Compare
Source](https://redirect.github.com/numpy/numpy/compare/v2.0.2...v2.1.0)

###
[`v2.0.2`](https://redirect.github.com/numpy/numpy/releases/tag/v2.0.2):
NumPy 2.0.2 release (Aug 26, 2024)

[Compare
Source](https://redirect.github.com/numpy/numpy/compare/v2.0.1...v2.0.2)

##### NumPy 2.0.2 Release Notes

NumPy 2.0.2 is a maintenance release that fixes bugs and regressions
discovered after the 2.0.1 release.

The Python versions supported by this release are 3.9-3.12.

##### Contributors

A total of 13 people contributed to this release. People with a "+" by
their names contributed a patch for the first time.

-   Bruno Oliveira +
-   Charles Harris
-   Chris Sidebottom
-   Christian Heimes +
-   Christopher Sidebottom
-   Mateusz Sokół
-   Matti Picus
-   Nathan Goldbaum
-   Pieter Eendebak
-   Raghuveer Devulapalli
-   Ralf Gommers
-   Sebastian Berg
-   Yair Chuchem +

##### Pull requests merged

A total of 19 pull requests were merged for this release.

- [#&#8203;27000](https://redirect.github.com/numpy/numpy/pull/27000):
REL: Prepare for the NumPy 2.0.1 release \[wheel build]
- [#&#8203;27001](https://redirect.github.com/numpy/numpy/pull/27001):
MAINT: prepare 2.0.x for further development
- [#&#8203;27021](https://redirect.github.com/numpy/numpy/pull/27021):
BUG: cfuncs.py: fix crash when sys.stderr is not available
- [#&#8203;27022](https://redirect.github.com/numpy/numpy/pull/27022):
DOC: Fix migration note for `alltrue` and `sometrue`
- [#&#8203;27061](https://redirect.github.com/numpy/numpy/pull/27061):
BUG: use proper input and output descriptor in array_assign_subscript...
- [#&#8203;27073](https://redirect.github.com/numpy/numpy/pull/27073):
BUG: Mirror VQSORT_ENABLED logic in Quicksort
- [#&#8203;27074](https://redirect.github.com/numpy/numpy/pull/27074):
BUG: Bump Highway to latest master
- [#&#8203;27077](https://redirect.github.com/numpy/numpy/pull/27077):
BUG: Off by one in memory overlap check
- [#&#8203;27122](https://redirect.github.com/numpy/numpy/pull/27122):
BUG: Use the new `npyv_loadable_stride_` functions for ldexp and...
- [#&#8203;27126](https://redirect.github.com/numpy/numpy/pull/27126):
BUG: Bump Highway to latest
- [#&#8203;27128](https://redirect.github.com/numpy/numpy/pull/27128):
BUG: add missing error handling in public_dtype_api.c
- [#&#8203;27129](https://redirect.github.com/numpy/numpy/pull/27129):
BUG: fix another cast setup in array_assign_subscript
- [#&#8203;27130](https://redirect.github.com/numpy/numpy/pull/27130):
BUG: Fix building NumPy in FIPS mode
- [#&#8203;27131](https://redirect.github.com/numpy/numpy/pull/27131):
BLD: update vendored Meson for cross-compilation patches
- [#&#8203;27146](https://redirect.github.com/numpy/numpy/pull/27146):
MAINT: Scipy openblas 0.3.27.44.4
- [#&#8203;27151](https://redirect.github.com/numpy/numpy/pull/27151):
BUG: Do not accidentally store dtype metadata in `np.save`
- [#&#8203;27195](https://redirect.github.com/numpy/numpy/pull/27195):
REV: Revert undef I and document it
- [#&#8203;27213](https://redirect.github.com/numpy/numpy/pull/27213):
BUG: Fix NPY_RAVEL_AXIS on backwards compatible NumPy 2 builds
- [#&#8203;27279](https://redirect.github.com/numpy/numpy/pull/27279):
BUG: Fix array_equal for numeric and non-numeric scalar types

##### Checksums

##### MD5

ae4bc199b56d20305984b7465d6fbdf1
numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl
ecce0a682c2ccaaa14500b87ffb69f63
numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl
a94f34bec8a62dab95ce9883a87a82a6
numpy-2.0.2-cp310-cp310-macosx_14_0_arm64.whl
a0a26dadf73264d31b7a6952b816d7c8
numpy-2.0.2-cp310-cp310-macosx_14_0_x86_64.whl
972f4366651a1a2ef00f630595104d15
numpy-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
6cffef937fe67a3879abefd3d2c40fb8
numpy-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
3717a5deda20f465720717a1a7a293a6
numpy-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
e31136ecc97bb76b3cb7e86bfc9471ac
numpy-2.0.2-cp310-cp310-musllinux_1_2_aarch64.whl
    9703a02ca6b63ca53f83660d089f4294  numpy-2.0.2-cp310-cp310-win32.whl
12c097ef2c7492282a5514b5c4b68784 numpy-2.0.2-cp310-cp310-win_amd64.whl
f11d11bfa3aaf371d2e7fa0160e3208b
numpy-2.0.2-cp311-cp311-macosx_10_9_x86_64.whl
86fc67666fc6e27740fde7dacb19c484
numpy-2.0.2-cp311-cp311-macosx_11_0_arm64.whl
5fd12e0dd7162ea9599c49bbb6e6730e
numpy-2.0.2-cp311-cp311-macosx_14_0_arm64.whl
a40f473db729ea10ae401ce71899120a
numpy-2.0.2-cp311-cp311-macosx_14_0_x86_64.whl
36ea96e0be954896597543d726157eda
numpy-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
cfa726b6d5445687020fc4d4f7191e42
numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
dfb9a7b7fe218e931b0dfb885a8250d6
numpy-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
d8bf100186e6cd1b2f27eb617ba9e581
numpy-2.0.2-cp311-cp311-musllinux_1_2_aarch64.whl
    4fe937eba0fc4d28a65c0ba571c809fc  numpy-2.0.2-cp311-cp311-win32.whl
a9a0f8e1bc4d825272514896e3b17f15 numpy-2.0.2-cp311-cp311-win_amd64.whl
5ef80ec3b2db487d89c590eb301a7aa4
numpy-2.0.2-cp312-cp312-macosx_10_9_x86_64.whl
1bb398d93422bb9baf63c958ed1aa492
numpy-2.0.2-cp312-cp312-macosx_11_0_arm64.whl
cc8d990a1ad3f4d66d0143ea709ccc99
numpy-2.0.2-cp312-cp312-macosx_14_0_arm64.whl
4fee57e854bc3e9a267e865740438d53
numpy-2.0.2-cp312-cp312-macosx_14_0_x86_64.whl
c2c18eef5118607c0b023f6267ee9774
numpy-2.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
2928ed26d7153a488bfb126424d86c8f
numpy-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
e32167073981b0a1a419aaaec741773e
numpy-2.0.2-cp312-cp312-musllinux_1_1_x86_64.whl
80a10803a3122472c1bf6c4617d0d1c5
numpy-2.0.2-cp312-cp312-musllinux_1_2_aarch64.whl
    39724e27a003b6ce9b1bcbf251e50b4b  numpy-2.0.2-cp312-cp312-win32.whl
8319d0b3d23285d4698cbece73b23fde numpy-2.0.2-cp312-cp312-win_amd64.whl
da0f655880bbcb53094816b77cd493d1
numpy-2.0.2-cp39-cp39-macosx_10_9_x86_64.whl
47347c028f6ccf47d6a22724111fc96f
numpy-2.0.2-cp39-cp39-macosx_11_0_arm64.whl
26a5c8dec993258522fcef84ef0c040e
numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl
fe447af86983ef2262e605a941bd46af
numpy-2.0.2-cp39-cp39-macosx_14_0_x86_64.whl
96477b8563e6d4e2db710f4915a4c5e0
numpy-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
4e8255cdff60de62944aed1f4235ff68
numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
05d8465b87ca983eee044b66bc725391
numpy-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
dcf448ef80720bae7de6724f92499754
numpy-2.0.2-cp39-cp39-musllinux_1_2_aarch64.whl
    71557f67f24d39db709cc4ccb85ae5b5  numpy-2.0.2-cp39-cp39-win32.whl
f5dc31c5530037c4d1d990696b1d041c numpy-2.0.2-cp39-cp39-win_amd64.whl
a8f814da1a4509724346c14cd838b5dc
numpy-2.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
918f072481d014229dd5f0f5ba75306f
numpy-2.0.2-pp39-pypy39_pp73-macosx_14_0_x86_64.whl
fcbe2e38506fbbbeda509a89063563d3
numpy-2.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
b99eff795ca26f8a513aace76a45a356
numpy-2.0.2-pp39-pypy39_pp73-win_amd64.whl
    d517a3be706295c4a4c8f75f5ee7b261  numpy-2.0.2.tar.gz

##### SHA256

51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece
numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl
f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04
numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl
8c5713284ce4e282544c68d1c3b2c7161d38c256d2eefc93c1d683cf47683e66
numpy-2.0.2-cp310-cp310-macosx_14_0_arm64.whl
becfae3ddd30736fe1889a37f1f580e245ba79a5855bff5f2a29cb3ccc22dd7b
numpy-2.0.2-cp310-cp310-macosx_14_0_x86_64.whl
2da5960c3cf0df7eafefd806d4e612c5e19358de82cb3c343631188991566ccd
numpy-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
496f71341824ed9f3d2fd36cf3ac57ae2e0165c143b55c3a035ee219413f3318
numpy-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
a61ec659f68ae254e4d237816e33171497e978140353c0c2038d46e63282d0c8
numpy-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
d731a1c6116ba289c1e9ee714b08a8ff882944d4ad631fd411106a30f083c326
numpy-2.0.2-cp310-cp310-musllinux_1_2_aarch64.whl
984d96121c9f9616cd33fbd0618b7f08e0cfc9600a7ee1d6fd9b239186d19d97
numpy-2.0.2-cp310-cp310-win32.whl
c7b0be4ef08607dd04da4092faee0b86607f111d5ae68036f16cc787e250a131
numpy-2.0.2-cp310-cp310-win_amd64.whl
49ca4decb342d66018b01932139c0961a8f9ddc7589611158cb3c27cbcf76448
numpy-2.0.2-cp311-cp311-macosx_10_9_x86_64.whl
11a76c372d1d37437857280aa142086476136a8c0f373b2e648ab2c8f18fb195
numpy-2.0.2-cp311-cp311-macosx_11_0_arm64.whl
807ec44583fd708a21d4a11d94aedf2f4f3c3719035c76a2bbe1fe8e217bdc57
numpy-2.0.2-cp311-cp311-macosx_14_0_arm64.whl
8cafab480740e22f8d833acefed5cc87ce276f4ece12fdaa2e8903db2f82897a
numpy-2.0.2-cp311-cp311-macosx_14_0_x86_64.whl
a15f476a45e6e5a3a79d8a14e62161d27ad897381fecfa4a09ed5322f2085669
numpy-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
13e689d772146140a252c3a28501da66dfecd77490b498b168b501835041f951
numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
9ea91dfb7c3d1c56a0e55657c0afb38cf1eeae4544c208dc465c3c9f3a7c09f9
numpy-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
c1c9307701fec8f3f7a1e6711f9089c06e6284b3afbbcd259f7791282d660a15
numpy-2.0.2-cp311-cp311-musllinux_1_2_aarch64.whl
a392a68bd329eafac5817e5aefeb39038c48b671afd242710b451e76090e81f4
numpy-2.0.2-cp311-cp311-win32.whl
286cd40ce2b7d652a6f22efdfc6d1edf879440e53e76a75955bc0c826c7e64dc
numpy-2.0.2-cp311-cp311-win_amd64.whl
df55d490dea7934f330006d0f81e8551ba6010a5bf035a249ef61a94f21c500b
numpy-2.0.2-cp312-cp312-macosx_10_9_x86_64.whl
8df823f570d9adf0978347d1f926b2a867d5608f434a7cff7f7908c6570dcf5e
numpy-2.0.2-cp312-cp312-macosx_11_0_arm64.whl
9a92ae5c14811e390f3767053ff54eaee3bf84576d99a2456391401323f4ec2c
numpy-2.0.2-cp312-cp312-macosx_14_0_arm64.whl
a842d573724391493a97a62ebbb8e731f8a5dcc5d285dfc99141ca15a3302d0c
numpy-2.0.2-cp312-cp312-macosx_14_0_x86_64.whl
c05e238064fc0610c840d1cf6a13bf63d7e391717d247f1bf0318172e759e692
numpy-2.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a
numpy-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
96a55f64139912d61de9137f11bf39a55ec8faec288c75a54f93dfd39f7eb40c
numpy-2.0.2-cp312-cp312-musllinux_1_1_x86_64.whl
ec9852fb39354b5a45a80bdab5ac02dd02b15f44b3804e9f00c556bf24b4bded
numpy-2.0.2-cp312-cp312-musllinux_1_2_aarch64.whl
671bec6496f83202ed2d3c8fdc486a8fc86942f2e69ff0e986140339a63bcbe5
numpy-2.0.2-cp312-cp312-win32.whl
cfd41e13fdc257aa5778496b8caa5e856dc4896d4ccf01841daee1d96465467a
numpy-2.0.2-cp312-cp312-win_amd64.whl
9059e10581ce4093f735ed23f3b9d283b9d517ff46009ddd485f1747eb22653c
numpy-2.0.2-cp39-cp39-macosx_10_9_x86_64.whl
423e89b23490805d2a5a96fe40ec507407b8ee786d66f7328be214f9679df6dd
numpy-2.0.2-cp39-cp39-macosx_11_0_arm64.whl
2b2955fa6f11907cf7a70dab0d0755159bca87755e831e47932367fc8f2f2d0b
numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl
97032a27bd9d8988b9a97a8c4d2c9f2c15a81f61e2f21404d7e8ef00cb5be729
numpy-2.0.2-cp39-cp39-macosx_14_0_x86_64.whl
1e795a8be3ddbac43274f18588329c72939870a16cae810c2b73461c40718ab1
numpy-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
f26b258c385842546006213344c50655ff1555a9338e2e5e02a0756dc3e803dd
numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
5fec9451a7789926bcf7c2b8d187292c9f93ea30284802a0ab3f5be8ab36865d
numpy-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
9189427407d88ff25ecf8f12469d4d39d35bee1db5d39fc5c168c6f088a6956d
numpy-2.0.2-cp39-cp39-musllinux_1_2_aarch64.whl
905d16e0c60200656500c95b6b8dca5d109e23cb24abc701d41c02d74c6b3afa
numpy-2.0.2-cp39-cp39-win32.whl
a3f4ab0caa7f053f6797fcd4e1e25caee367db3112ef2b6ef82d749530768c73
numpy-2.0.2-cp39-cp39-win_amd64.whl
7f0a0c6f12e07fa94133c8a67404322845220c06a9e80e85999afe727f7438b8
numpy-2.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
312950fdd060354350ed123c0e25a71327d3711584beaef30cdaa93320c392d4
numpy-2.0.2-pp39-pypy39_pp73-macosx_14_0_x86_64.whl
26df23238872200f63518dd2aa984cfca675d82469535dc7162dc2ee52d9dd5c
numpy-2.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
a46288ec55ebbd58947d31d72be2c63cbf839f0a63b49cb755022310792a3385
numpy-2.0.2-pp39-pypy39_pp73-win_amd64.whl
883c987dee1880e2a864ab0dc9892292582510604156762362d9326444636e78
numpy-2.0.2.tar.gz

###
[`v2.0.1`](https://redirect.github.com/numpy/numpy/compare/v2.0.0...v2.0.1)

[Compare
Source](https://redirect.github.com/numpy/numpy/compare/v2.0.0...v2.0.1)

###
[`v2.0.0`](https://redirect.github.com/numpy/numpy/releases/tag/v2.0.0)

[Compare
Source](https://redirect.github.com/numpy/numpy/compare/v1.26.4...v2.0.0)

### NumPy 2.0.0 Release Notes

NumPy 2.0.0 is the first major release since 2006. It is the result of
11 months of development since the last feature release and is the work
of 212 contributors spread over 1078 pull requests. It contains a large
number of exciting new features as well as changes to both the Python
and C APIs.

This major release includes breaking changes that could not happen in a
regular minor (feature) release - including an ABI break, changes to
type promotion rules, and API changes which may not have been emitting
deprecation warnings in 1.26.x. Key documents related to how to adapt to
changes in NumPy 2.0, in addition to these release notes, include:

- The
[numpy-2-migration-guide](https://numpy.org/devdocs/numpy\_2\_0\_migration_guide.html)
- The Numpy 2.0-specific advice in [for downstream package
authors](https://numpy.org/devdocs/dev/depending_on_numpy.html)

#### Highlights

Highlights of this release include:

-   New features:
- A new variable-length string dtype, `numpy.dtypes.StringDType` and a
new
`numpy.strings` namespace with performant ufuncs for string operations,
    -   Support for `float32` and `longdouble` in all
        `numpy.fft` functions,
    -   Support for the array API standard in the main `numpy`
        namespace.
-   Performance improvements:
    -   Sorting functions `sort`, `argsort`,
        `partition`, `argpartition` have been
        accelerated through the use of the Intel x86-simd-sort and
        Google Highway libraries, and may see large (hardware-specific)
        speedups,
    -   macOS Accelerate support and binary wheels for macOS >=14, with
        significant performance improvements for linear algebra
        operations on macOS, and wheels that are about 3 times smaller,
    -   `numpy.char` fixed-length string operations have
        been accelerated by implementing ufuncs that also support
        `numpy.dtypes.StringDType` in addition to the
        fixed-length string dtypes,
    -   A new tracing and introspection API,
        `numpy.lib.introspect.opt_func_info`, to determine
        which hardware-specific kernels are available and will be
        dispatched to.
    -   `numpy.save` now uses pickle protocol version 4 for saving
        arrays with object dtype, which allows for pickle objects larger
        than 4GB and improves saving speed by about 5% for large arrays.
-   Python API improvements:
    -   A clear split between public and private API, with a new module
structure and each public function now available in a single place.
    -   Many removals of non-recommended functions and aliases. This
        should make it easier to learn and use NumPy. The number of
        objects in the main namespace decreased by ~10% and in
        `numpy.lib` by ~80%.
- ` Canonical dtype names and a new `numpy.isdtype\` introspection
        function,
-   C API improvements:
    -   A new public C API for creating custom dtypes,
    -   Many outdated functions and macros removed, and private
        internals hidden to ease future extensibility,
- New, easier to use, initialization functions: `PyArray_ImportNumPyAPI`
        and `PyUFunc_ImportUFuncAPI`.
-   Improved behavior:
- Improvements to type promotion behavior was changed by adopting NEP
50.
This fixes many user surprises about promotions which previously often
depended on data values of input arrays rather than only their dtypes.
Please see the NEP and the numpy-2-migration-guide for details as this
change can lead to changes in output dtypes and lower precision results
        for mixed-dtype operations.
    -   The default integer type on Windows is now `int64` rather than
        `int32`, matching the behavior on other platforms,
    -   The maximum number of array dimensions is changed from 32 to 64
-   Documentation:
    -   The reference guide navigation was significantly improved, and
        there is now documentation on NumPy's
        module structure,
    -   The building from source documentation was completely rewritten,

Furthermore there are many changes to NumPy internals, including
continuing to migrate code from C to C++, that will make it easier to
improve and maintain NumPy in the future.

The "no free lunch" theorem dictates that there is a price to pay for
all these API and behavior improvements and better future extensibility.
This price is:

1.  Backwards compatibility. There are a significant number of breaking
    changes to both the Python and C APIs. In the majority of cases,
    there are clear error messages that will inform the user how to
    adapt their code. However, there are also changes in behavior for
    which it was not possible to give such an error message - these
    cases are all covered in the Deprecation and Compatibility sections
    below, and in the numpy-2-migration-guide.

    Note that there is a `ruff` mode to auto-fix many things in Python
    code.

2.  Breaking changes to the NumPy ABI. As a result, binaries of packages
    that use the NumPy C API and were built against a NumPy 1.xx release
    will not work with NumPy 2.0. On import, such packages will see an
    `ImportError` with a message about binary incompatibility.

    It is possible to build binaries against NumPy 2.0 that will work at
runtime with both NumPy 2.0 and 1.x. See numpy-2-abi-handling for more
    details.

    **All downstream packages that depend on the NumPy ABI are advised
    to do a new release built against NumPy 2.0 and verify that that
    release works with both 2.0 and 1.26 - ideally in the period between
    2.0.0rc1 (which will be ABI-stable) and the final 2.0.0 release to
    avoid problems for their users.**

The Python versions supported by this release are 3.9-3.12.

#### NumPy 2.0 Python API removals

-   `np.geterrobj`, `np.seterrobj` and the related ufunc keyword
    argument `extobj=` have been removed. The preferred replacement for
    all of these is using the context manager `with np.errstate():`.

    ([gh-23922](https://redirect.github.com/numpy/numpy/pull/23922))

-   `np.cast` has been removed. The literal replacement for
    `np.cast[dtype](arg)` is `np.asarray(arg, dtype=dtype)`.

-   `np.source` has been removed. The preferred replacement is
    `inspect.getsource`.

-   `np.lookfor` has been removed.

    ([gh-24144](https://redirect.github.com/numpy/numpy/pull/24144))

-   `numpy.who` has been removed. As an alternative for the removed
    functionality, one can use a variable explorer that is available in
    IDEs such as Spyder or Jupyter Notebook.

    ([gh-24321](https://redirect.github.com/numpy/numpy/pull/24321))

-   Warnings and exceptions present in `numpy.exceptions`,
    e.g, `numpy.exceptions.ComplexWarning`,
    `numpy.exceptions.VisibleDeprecationWarning`, are no
    longer exposed in the main namespace.

-   Multiple niche enums, expired members and functions have been
    removed from the main namespace, such as: `ERR_*`, `SHIFT_*`,
    `np.fastCopyAndTranspose`, `np.kernel_version`, `np.numarray`,
    `np.oldnumeric` and `np.set_numeric_ops`.

    ([gh-24316](https://redirect.github.com/numpy/numpy/pull/24316))

-   Replaced `from ... import *` in the `numpy/__init__.py` with
    explicit imports. As a result, these main namespace members got
    removed: `np.FLOATING_POINT_SUPPORT`, `np.FPE_*`, `np.NINF`,
    `np.PINF`, `np.NZERO`, `np.PZERO`, `np.CLIP`, `np.WRAP`, `np.WRAP`,
    `np.RAISE`, `np.BUFSIZE`, `np.UFUNC_BUFSIZE_DEFAULT`,
    `np.UFUNC_PYVALS_NAME`, `np.ALLOW_THREADS`, `np.MAXDIMS`,
    `np.MAY_SHARE_EXACT`, `np.MAY_SHARE_BOUNDS`, `add_newdoc`,
    `np.add_docstring` and `np.add_newdoc_ufunc`.

    ([gh-24357](https://redirect.github.com/numpy/numpy/pull/24357))

-   Alias `np.float_` has been removed. Use `np.float64` instead.

-   Alias `np.complex_` has been removed. Use `np.complex128` instead.

-   Alias `np.longfloat` has been removed. Use `np.longdouble` instead.

-   Alias `np.singlecomplex` has been removed. Use `np.complex64`
    instead.

-   Alias `np.cfloat` has been removed. Use `np.complex128` instead.

-   Alias `np.longcomplex` has been removed. Use `np.clongdouble`
    instead.

-   Alias `np.clongfloat` has been removed. Use `np.clongdouble`
    instead.

-   Alias `np.string_` has been removed. Use `np.bytes_` instead.

-   Alias `np.unicode_` has been removed. Use `np.str_` instead.

-   Alias `np.Inf` has been removed. Use `np.inf` instead.

-   Alias `np.Infinity` has been removed. Use `np.inf` instead.

-   Alias `np.NaN` has been removed. Use `np.nan` instead.

-   Alias `np.infty` has been removed. Use `np.inf` instead.

-   Alias `np.mat` has been removed. Use `np.asmatrix` instead.

-   `np.issubclass_` has been removed. Use the `issubclass` builtin
    instead.

-   `np.asfarray` has been removed. Use `np.asarray` with a proper dtype
    instead.

-   `np.set_string_function` has been removed. Use `np.set_printoptions`
    instead with a formatter for custom printing of NumPy objects.

-   `np.tracemalloc_domain` is now only available from `np.lib`.

-   `np.recfromcsv` and `recfromtxt` are now only available from
    `np.lib.npyio`.

-   `np.issctype`, `np.maximum_sctype`, `np.obj2sctype`,
    `np.sctype2char`, `np.sctypes`, `np.issubsctype` were all removed
    from the main namespace without replacement, as they where niche
    members.

-   Deprecated `np.deprecate` and `np.deprecate_with_doc` has been
    removed from the main namespace. Use `DeprecationWarning` instead.

-   Deprecated `np.safe_eval` has been removed from the main namespace.
    Use `ast.literal_eval` instead.

    ([gh-24376](https://redirect.github.com/numpy/numpy/pull/24376))

-   `np.find_common_type` has been removed. Use `numpy.promote_types` or
    `numpy.result_type` instead. To achieve semantics for the
    `scalar_types` argument, use `numpy.result_type` and pass `0`,
    `0.0`, or `0j` as a Python scalar instead.

-   `np.round_` has been removed. Use `np.round` instead.

-   `np.nbytes` has been removed. Use `np.dtype(<dtype>).itemsize`
    instead.

    ([gh-24477](https://redirect.github.com/numpy/numpy/pull/24477))

-   `np.compare_chararrays` has been removed from the main namespace.
    Use `np.char.compare_chararrays` instead.

-   The `charrarray` in the main namespace has been deprecated. It can
    be imported without a deprecation warning from `np.char.chararray`
    for now, but we are planning to fully deprecate and remove
    `chararray` in the future.

-   `np.format_parser` has been removed from the main namespace. Use
    `np.rec.format_parser` instead.

    ([gh-24587](https://redirect.github.com/numpy/numpy/pull/24587))

-   Support for seven data type string aliases has been removed from
    `np.dtype`: `int0`, `uint0`, `void0`, `object0`, `str0`, `bytes0`
    and `bool8`.

    ([gh-24807](https://redirect.github.com/numpy/numpy/pull/24807))

-   The experimental `numpy.array_api` submodule has been removed. Use
    the main `numpy` namespace for regular usage instead, or the
    separate `array-api-strict` package for the compliance testing use
    case for which `numpy.array_api` was mostly used.

    ([gh-25911](https://redirect.github.com/numpy/numpy/pull/25911))

##### `__array_prepare__` is removed

UFuncs called `__array_prepare__` before running computations for normal
ufunc calls (not generalized ufuncs, reductions, etc.). The function was
also called instead of `__array_wrap__` on the results of some linear
algebra functions.

It is now removed. If you use it, migrate to `__array_ufunc__` or rely
on `__array_wrap__` which is called with a context in all cases,
although only after the result array is filled. In those code paths,
`__array_wrap__` will now be passed a base class, rather than a subclass
array.

([gh-25105](https://redirect.github.com/numpy/numpy/pull/25105))

#### Deprecations

-   `np.compat` has been deprecated, as Python 2 is no longer supported.

-   `numpy.int8` and similar classes will no longer support conversion
    of out of bounds python integers to integer arrays. For example,
    conversion of 255 to int8 will not return -1. `numpy.iinfo(dtype)`
    can be used to check the machine limits for data types. For example,
    `np.iinfo(np.uint16)` returns min = 0 and max = 65535.

    `np.array(value).astype(dtype)` will give the desired result.

-   `np.safe_eval` has been deprecated. `ast.literal_eval` should be
    used instead.

    ([gh-23830](https://redirect.github.com/numpy/numpy/pull/23830))

-   `np.recfromcsv`, `np.recfromtxt`, `np.disp`, `np.get_array_wrap`,
    `np.maximum_sctype`, `np.deprecate` and `np.deprecate_with_doc` have
    been deprecated.

    ([gh-24154](https://redirect.github.com/numpy/numpy/pull/24154))

-   `np.trapz` has been deprecated. Use `np.trapezoid` or a
    `scipy.integrate` function instead.

-   `np.in1d` has been deprecated. Use `np.isin` instead.

-   Alias `np.row_stack` has been deprecated. Use `np.vstack` directly.

    ([gh-24445](https://redirect.github.com/numpy/numpy/pull/24445))

-   `__array_wrap__` is now passed `arr, context, return_scalar` and
    support for implementations not accepting all three are deprecated.
    Its signature should be
    `__array_wrap__(self, arr, context=None, return_scalar=False)`

    ([gh-25409](https://redirect.github.com/numpy/numpy/pull/25409))

-   Arrays of 2-dimensional vectors for `np.cross` have been deprecated.
    Use arrays of 3-dimensional vectors instead.

    ([gh-24818](https://redirect.github.com/numpy/numpy/pull/24818))

-   `np.dtype("a")` alias for `np.dtype(np.bytes_)` was deprecated. Use
    `np.dtype("S")` alias instead.

    ([gh-24854](https://redirect.github.com/numpy/numpy/pull/24854))

-   Use of keyword arguments `x` and `y` with functions
    `assert_array_equal` and `assert_array_almost_equal` has been
    deprecated. Pass the first two arguments as positional arguments
    instead.

    ([gh-24978](https://redirect.github.com/numpy/numpy/pull/24978))

##### `numpy.fft` deprecations for n-D transforms with None values in
arguments

Using `fftn`, `ifftn`, `rfftn`, `irfftn`, `fft2`, `ifft2`, `rfft2` or
`irfft2` with the `s` parameter set to a value that is not `None` and
the `axes` parameter set to `None` has been deprecated, in line with the
array API standard. To retain current behaviour, pass a sequence \[0,
..., k-1] to `axes` for an array of dimension k.

Furthermore, passing an array to `s` which contains `None` values is
deprecated as the parameter is documented to accept a sequence of
integers in both the NumPy docs and the array API specification. To use
the default behaviour of the corresponding 1-D transform, pass the value
matching the default for its `n` parameter. To use the default behaviour
for every axis, the `s` argument can be omitted.

([gh-25495](https://redirect.github.com/numpy/numpy/pull/25495))

##### `np.linalg.lstsq` now defaults to a new `rcond` value

`numpy.linalg.lstsq` now uses the new rcond value of the
machine precision times `max(M, N)`. Previously, the machine precision
was used but a FutureWarning was given to notify that this change will
happen eventually. That old behavior can still be achieved by passing
`rcond=-1`.

([gh-25721](https://redirect.github.com/numpy/numpy/pull/25721))

#### Expired deprecations

-   The `np.core.umath_tests` submodule has been removed from the public
    API. (Deprecated in NumPy 1.15)

    ([gh-23809](https://redirect.github.com/numpy/numpy/pull/23809))

-   The `PyDataMem_SetEventHook` deprecation has expired and it is
    removed. Use `tracemalloc` and the `np.lib.tracemalloc_domain`
    domain. (Deprecated in NumPy 1.23)

    ([gh-23921](https://redirect.github.com/numpy/numpy/pull/23921))

-   The deprecation of `set_numeric_ops` and the C functions
    `PyArray_SetNumericOps` and `PyArray_GetNumericOps` has been expired
    and the functions removed. (Deprecated in NumPy 1.16)

    ([gh-23998](https://redirect.github.com/numpy/numpy/pull/23998))

-   The `fasttake`, `fastclip`, and `fastputmask` `ArrFuncs` deprecation
    is now finalized.

-   The deprecated function `fastCopyAndTranspose` and its C counterpart
    are now removed.

-   The deprecation of `PyArray_ScalarFromObject` is now finalized.

    ([gh-24312](https://redirect.github.com/numpy/numpy/pull/24312))

-   `np.msort` has been removed. For a replacement, `np.sort(a, axis=0)`
    should be used instead.

    ([gh-24494](https://redirect.github.com/numpy/numpy/pull/24494))

-   `np.dtype(("f8", 1)` will now return a shape 1 subarray dtype rather
    than a non-subarray one.

    ([gh-25761](https://redirect.github.com/numpy/numpy/pull/25761))

-   Assigning to the `.data` attribute of an ndarray is disallowed and
    will raise.

-   `np.binary_repr(a, width)` will raise if width is too small.

-   Using `NPY_CHAR` in `PyArray_DescrFromType()` will raise, use
    `NPY_STRING` `NPY_UNICODE`, or `NPY_VSTRING` instead.

    ([gh-25794](https://redirect.github.com/numpy/numpy/pull/25794))

#### Compatibility notes

##### `loadtxt` and `genfromtxt` default encoding changed

`loadtxt` and `genfromtxt` now both default to `encoding=None` which may
mainly modify how `converters` work. These will now be passed `str`
rather than `bytes`. Pass the encoding explicitly to always get the new
or old behavior. For `genfromtxt` the change also means that returned
values will now be unicode strings rather than bytes.

([gh-25158](https://redirect.github.com/numpy/numpy/pull/25158))

##### `f2py` compatibility notes

-   `f2py` will no longer accept ambiguous `-m` and `.pyf` CLI
    combinations. When more than one `.pyf` file is passed, an error is
    raised. When both `-m` and a `.pyf` is passed, a warning is emitted
    and the `-m` provided name is ignored.

    ([gh-25181](https://redirect.github.com/numpy/numpy/pull/25181))

-   The `f2py.compile()` helper has been removed because it leaked
    memory, has been marked as experimental for several years now, and
    was implemented as a thin `subprocess.run` wrapper. It was also one
    of the test bottlenecks. See
[gh-25122](https://redirect.github.com/numpy/numpy/issues/25122) for the
full
    rationale. It also used several `np.distutils` features which are
    too fragile to be ported to work with `meson`.

-   Users are urged to replace calls to `f2py.compile` with calls to
    `subprocess.run("python", "-m", "numpy.f2py",...` instead, and to
    use environment variables to interact with `meson`. [Native
    files](https://mesonbuild.com/Machine-files.html) are also an
    option.

    ([gh-25193](https://redirect.github.com/numpy/numpy/pull/25193))

##### Minor changes in behavior of sorting functions

Due to algorithmic changes and use of SIMD code, sorting functions with
methods that aren't stable may return slightly different results in
2.0.0 compared to 1.26.x. This includes the default method of
`numpy.argsort` and `numpy.argpartition`.

##### Removed ambiguity when broadcasting in `np.solve`

The broadcasting rules for `np.solve(a, b)` were ambiguous when `b` had
1 fewer dimensions than `a`. This has been resolved in a
backward-incompatible way and is now compliant with the Array API. The
old behaviour can be reconstructed by using
`np.solve(a, b[..., None])[..., 0]`.

([gh-25914](https://redirect.github.com/numpy/numpy/pull/25914))

##### Modified representation for `Polynomial`

The representation method for
`numpy.polynomial.polynomial.Polynomial` was updated to
include the domain in the representation. The plain text and latex
representations are now consistent. For example the output of
`str(np.polynomial.Polynomial([1, 1], domain=[.1, .2]))` used to be
`1.0 + 1.0 x`, but now is `1.0 + 1.0 (-3.0000000000000004 + 20.0 x)`.

([gh-21760](https://redirect.github.com/numpy/numpy/pull/21760))

#### C API changes

-   The `PyArray_CGT`, `PyArray_CLT`, `PyArray_CGE`, `PyArray_CLE`,
    `PyArray_CEQ`, `PyArray_CNE` macros have been removed.

-   `PyArray_MIN` and `PyArray_MAX` have been moved from
    `ndarraytypes.h` to `npy_math.h`.

    ([gh-24258](https://redirect.github.com/numpy/numpy/pull/24258))

-   A C API for working with `numpy.dtypes.StringDType`
    arrays has been exposed. This includes functions for acquiring and
    releasing mutexes which lock access to the string data, as well as
    packing and unpacking UTF-8 bytestreams from array entries.

-   `NPY_NTYPES` has been renamed to `NPY_NTYPES_LEGACY` as it does not
    include new NumPy built-in DTypes. In particular the new string
    DType will likely not work correctly with code that handles legacy
    DTypes.

    ([gh-25347](https://redirect.github.com/numpy/numpy/pull/25347))

-   The C-API now only exports the static inline function versions of
    the array accessors (previously this depended on using "deprecated
    API"). While we discourage it, the struct fields can still be used
    directly.

    ([gh-25789](https://redirect.github.com/numpy/numpy/pull/25789))

- NumPy now defines `PyArray_Pack` to set an individual memory address.
    Unlike `PyArray_SETITEM` this function is equivalent to setting an
    individual array item and does not require a NumPy array input.

    ([gh-25954](https://redirect.github.com/numpy/numpy/pull/25954))

- The `->f` slot has been removed from `PyArray_Descr`. If you use this
slot,
replace accessing it with `PyDataType_GetArrFuncs` (see its
documentation
and the `numpy-2-migration-guide`). In some cases using other functions
    like `PyArray_GETITEM` may be an alternatives.

-   `PyArray_GETITEM` and `PyArray_SETITEM` now require the import of
    the NumPy API table to be used and are no longer defined in
    `ndarraytypes.h`.

    ([gh-25812](https://redirect.github.com/numpy/numpy/pull/25812))

-   Due to runtime dependencies, the definition for functionality
    accessing the dtype flags was moved from `numpy/ndarraytypes.h` and
    is only available after including `numpy/ndarrayobject.h` as it
    requires `import_array()`. This includes `PyDataType_FLAGCHK`,
    `PyDataType_REFCHK` and `NPY_BEGIN_THREADS_DESCR`.

-   The dtype flags on `PyArray_Descr` must now be accessed through the
    `PyDataType_FLAGS` inline function to be compatible with both 1.x
    and 2.x. This function is defined in `npy_2_compat.h` to allow
    backporting. Most or all users should use `PyDataType_FLAGCHK` which
    is available on 1.x and does not require backporting. Cython users
    should use Cython 3. Otherwise access will go through Python unless
    they use `PyDataType_FLAGCHK` instead.

    ([gh-25816](https://redirect.github.com/numpy/numpy/pull/25816))

##### Datetime functionality exposed in the C API and Cython bindings

The functions `NpyDatetime_ConvertDatetime64ToDatetimeStruct`,
`NpyDatetime_ConvertDatetimeStructToDatetime64`,
`NpyDatetime_ConvertPyDateTimeToDatetimeStruct`,
`NpyDatetime_GetDatetimeISO8601StrLen`,
`NpyDatetime_MakeISO8601Datetime`, and
`NpyDatetime_ParseISO8601Datetime` have been added to the C API to
facilitate converting between strings, Python datetimes, and NumPy
datetimes in external libraries.

([gh-21199](https://redirect.github.com/numpy/numpy/pull/21199))

##### Const correctness for the generalized ufunc C API

The NumPy C API's functions for constructing generalized ufuncs
(`PyUFunc_FromFuncAndData`, `PyUFunc_FromFuncAndDataAndSignature`,
`PyUFunc_FromFuncAndDataAndSignatureAndIdentity`) take `types` and
`data` arguments that are not modified by NumPy's internals. Like the
`name` and `doc` arguments, third-party Python extension modules are
likely to supply these arguments from static constants. The `types` and
`data` arguments are now const-correct: they are declared as
`const char *types` and `void *const *data`, respectively. C code should
not be affected, but C++ code may be.

([gh-23847](https://redirect.github.com/numpy/numpy/pull/23847))

##### Larger `NPY_MAXDIMS` and `NPY_MAXARGS`, `NPY_RAVEL_AXIS`
introduced

`NPY_MAXDIMS` is now 64, you may want to review its use. This is usually
used in a stack allocation, where the increase should be safe. However,
we do encourage generally to remove any use of `NPY_MAXDIMS` and
`NPY_MAXARGS` to eventually allow removing the constraint completely.
For the conversion helper and C-API functions mirroring Python ones such
as
`take`, `NPY_MAXDIMS` was used to mean `axis=None`. Such usage must be
replaced
with `NPY_RAVEL_AXIS`. See also `migration_maxdims`.

([gh-25149](https://redirect.github.com/numpy/numpy/pull/25149))

##### `NPY_MAXARGS` not constant and `PyArrayMultiIterObject` size
change

Since `NPY_MAXARGS` was increased, it is now a runtime constant and not
compile-time constant anymore. We expect almost no users to notice this.
But if used for stack allocations it now must be replaced with a custom
constant using `NPY_MAXARGS` as an additional runtime check.

The `sizeof(PyArrayMultiIterObject)` no longer includes the full size of
the object. We expect nobody to notice this change. It was necessary to
avoid issues with Cython.

([gh-25271](https://redirect.github.com/numpy/numpy/pull/25271))

##### Required changes for custom legacy user dtypes

In order to improve our DTypes it is unfortunately necessary to break
the ABI, which requires some changes for dtypes registered with
`PyArray_RegisterDataType`. Please see the documentation of
`PyArray_RegisterDataType` for how to adapt your code and achieve
compatibility with both 1.x and 2.x.

([gh-25792](https://redirect.github.com/numpy/numpy/pull/25792))

##### New Public DType API

The C implementation of the NEP 42 DType API is now public. While the
DType API has shipped in NumPy for a few versions, it was only usable in
sessions with a special environment variable set. It is now possible to
write custom DTypes outside of NumPy using the new DType API and the
normal `import_array()` mechanism for importing the numpy C API.

See `dtype-api` for more details about the API. As always with a new
feature,
please report any bugs you run into implementing or using a new DType.
It is
likely that downstream C code that works with dtypes will need to be
updated to
work correctly with new DTypes.

([gh-25754](https://redirect.github.com/numpy/numpy/pull/25754))

##### New C-API import functions

We have now added `PyArray_ImportNumPyAPI` and `PyUFunc_ImportUFuncAPI`
as static inline functions to import the NumPy C-API tables. The new
functions have two advantages over `import_array` and `import_ufunc`:

-   They check whether the import was already performed and are
    light-weight if not, allowing to add them judiciously (although this
    is not preferable in most cases).
-   The old mechanisms were macros rather than functions which included
    a `return` statement.

The `PyArray_ImportNumPyAPI()` function is included in `npy_2_compat.h`
for simpler backporting.

([gh-25866](https://redirect.github.com/numpy/numpy/pull/25866))

##### Structured dtype information access through functions

The dtype structures fields `c_metadata`, `names`, `fields`, and
`subarray` must now be accessed through new functions following the same
names, such as `PyDataType_NAMES`. Direct access of the fields is not
valid as they do not exist for all `PyArray_Descr` instances. The
`metadata` field is kept, but the macro version should also be
preferred.

([gh-25802](https://redirect.github.com/numpy/numpy/pull/25802))

##### Descriptor `elsize` and `alignment` access

Unless compiling only with NumPy 2 support, the `elsize` and `aligment`
fields must now be accessed via `PyDataType_ELSIZE`,
`PyDataType_SET_ELSIZE`, and `PyDataType_ALIGNMENT`. In cases where the
descriptor is attached to an array, we advise using `PyArray_ITEMSIZE`
as it exists on all NumPy versions. Please see
`migration_c_descr` for more information.

([gh-25943](https://redirect.github.com/numpy/numpy/pull/25943))

#### NumPy 2.0 C API removals

-   `npy_interrupt.h` and the corresponding macros like `NPY_SIGINT_ON`
    have been removed. We recommend querying `PyErr_CheckSignals()` or
    `PyOS_InterruptOccurred()` periodically (these do currently require
    holding the GIL though).

-   The `noprefix.h` header has been removed. Replace missing symbols
    with their prefixed counterparts (usually an added `NPY_` or
    `npy_`).

    ([gh-23919](https://redirect.github.com/numpy/numpy/pull/23919))

-   `PyUFunc_GetPyVals`, `PyUFunc_handlefperr`, and `PyUFunc_checkfperr`
    have been removed. If needed, a new backwards compatible function to
    raise floating point errors could be restored. Reason for removal:
    there are no known users and the functions would have made
    `with np.errstate()` fixes much more difficult).

    ([gh-23922](https://redirect.github.com/numpy/numpy/pull/23922))

-   The `numpy/old_defines.h` which was part of the API deprecated since
    NumPy 1.7 has been removed. This removes macros of the form
    `PyArray_CONSTANT`. The

[replace_old_macros.sed](https://redirect.github.com/numpy/numpy/blob/main/tools/replace_old_macros.sed)
    script may be useful to convert them to the `NPY_CONSTANT` version.

    ([gh-24011](https://redirect.github.com/numpy/numpy/pull/24011))

-   The `legacy_inner_loop_selector` member of the ufunc struct is
    removed to simplify improvements to the dispatching system. There
    are no known users overriding or directly accessing this member.

    ([gh-24271](https://redirect.github.com/numpy/numpy/pull/24271))

-   `NPY_INTPLTR` has been removed to avoid confusion (see `intp`
    redefinition).

    ([gh-24888](https://redirect.github.com/numpy/numpy/pull/24888))

-   The advanced indexing `MapIter` and related API has been removed.
    The (truly) public part of it was not well tested and had only one
    known user (Theano). Making it private will simplify improvements to
    speed up `ufunc.at`, make advanced indexing more maintainable, and
    was important for increasing the maximum number of dimensions of
    arrays to 64. Please let us know if this API is important to you so
    we can find a solution together.

    ([gh-25138](https://redirect.github.com/numpy/numpy/pull/25138))

-   The `NPY_MAX_ELSIZE` macro has been removed, as it only ever
    reflected builtin numeric types and served no internal purpose.

    ([gh-25149](https://redirect.github.com/numpy/numpy/pull/25149))

-   `PyArray_REFCNT` and `NPY_REFCOUNT` are removed. Use `Py_REFCNT`
    instead.

    ([gh-25156](https://redirect.github.com/numpy/numpy/pull/25156))

-   `PyArrayFlags_Type` and `PyArray_NewFlagsObject` as well as
    `PyArrayFlagsObject` are private now. There is no known use-case;
    use the Python API if needed.

-   `PyArray_MoveInto`, `PyArray_CastTo`, `PyArray_CastAnyTo` are
    removed use `PyArray_CopyInto` and if absolutely needed
    `PyArray_CopyAnyInto` (the latter does a flat copy).

-   `PyArray_FillObjectArray` is removed, its only true use was for
    implementing `np.empty`. Create a new empty array or use
    `PyArray_FillWithScalar()` (decrefs existing objects).

-   `PyArray_CompareUCS4` and `PyArray_CompareString` are removed. Use
    the standard C string comparison functions.

-   `PyArray_ISPYTHON` is removed as it is misleading, has no known
    use-cases, and is easy to replace.

-   `PyArray_FieldNames` is removed, as it is unclear what it would be
    useful for. It also has incorrect semantics in some possible
    use-cases.

-   `PyArray_TypestrConvert` is removed, since it seems a misnomer and
    unlikely to be used by anyone. If you know the size or are limited
    to few types, just use it explicitly, otherwise go via Python
    strings.

    ([gh-25292](https://redirect.github.com/numpy/numpy/pull/25292))

-   `PyDataType_GetDatetimeMetaData` is removed, it did not actually do
    anything since at least NumPy 1.7.

    ([gh-25802](https://redirect.github.com/numpy/numpy/pull/25802))

-   `PyArray_GetCastFunc` is removed. Note that custom legacy user
    dtypes can still provide a castfunc as their implementation, but any
    access to them is now removed. The reason for this is that NumPy
    never used these internally for many years. If you use simple
    numeric types, please just use C casts directly. In case you require
    an alternative, please let us know so we can create new API such as
    `PyArray_CastBuffer()` which could use old or new cast functions
    depending on the NumPy version.

    ([gh-25161](https://redirect.github.com/numpy/numpy/pull/25161))

#### New Features

##### `np.add` was extended to work with `unicode` and `bytes` dtypes.

> ([gh-24858](https://redirect.github.com/numpy/numpy/pull/24858))

##### A new `bitwise_count` function

This new function counts the number of 1-bits in a number.
`numpy.bitwise_count` works on all the numpy integer types
and integer-like objects.

```python
>>> a = np.array([2**i - 1 for i in range(16)])
>>> np.bitwise_count(a)
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15],
      dtype=uint8)
```

([gh-19355](https://redirect.github.com/numpy/numpy/pull/19355))

##### macOS Accelerate support, including the ILP64

Support for the updated Accelerate BLAS/LAPACK library, including ILP64
(64-bit integer) support, in macOS 13.3 has been added. This brings
arm64 support, and significant performance improvements of up to 10x for
commonly used linear algebra operations. When Accelerate is selected at
build time, or if no explicit BLAS library selection is done, the 13.3+
version will automatically be used if available.

([gh-24053](https://redirect.github.com/numpy/numpy/pull/24053))

Binary wheels are also available. On macOS >=14.0, users who install
NumPy from PyPI will get wheels built against Accelerate rather than
OpenBLAS.

([gh-25255](https://redirect.github.com/numpy/numpy/pull/25255))

##### Option to use weights for quantile and percentile functions

A `weights` keyword is now available for `numpy.quantile`,
`numpy.percentile`,
`numpy.nanquantile` and `numpy.nanpercentile`. Only
`method="inverted_cdf"`
supports weights.

([gh-24254](https://redirect.github.com/numpy/numpy/pull/24254))

##### Improved CPU optimization tracking

A new tracer mechanism is available which enables tracking of the
enabled targets for each optimized function (i.e., that uses
hardware-specific SIMD instructions) in the NumPy library. With this
enhancement, it becomes possible to precisely monitor the enabled CPU
dispatch targets for the dispatched functions.

A new function named `opt_func_info` has been added to the new namespace
`numpy.lib.introspect`, offering this tracing capability. This function
allows
you to retrieve information about the enabled targets based on function
names
and data type signatures.

([gh-24420](https://redirect.github.com/numpy/numpy/pull/24420))

##### A new Meson backend for `f2py`

`f2py` in compile mode (i.e. `f2py -c`) now accepts the
`--backend meson` option. This is the default option for Python >=3.12.
For older Python versions, `f2py` will still default to
`--backend distutils`.

To support this in realistic use-cases, in compile mode `f2py` takes a
`--dep` flag one or many times which maps to `dependency()` calls in the
`meson` backend, and does nothing in the `distutils` backend.

There are no changes for users of `f2py` only as a code generator, i.e.
without `-c`.

([gh-24532](https://redirect.github.com/numpy/numpy/pull/24532))

##### `bind(c)` support for `f2py`

Both functions and subroutines can be annotated with `bind(c)`. `f2py`
will handle both the correct type mapping, and preserve the unique label
for other C interfaces.

**Note:** `bind(c, name = 'routine_name_other_than_fortran_routine')` is
not honored by the `f2py` bindings by design, since `bind(c)` with the
`name` is meant to guarantee only the same name in C and Fortran, not in
Python and Fortran.

([gh-24555](https://redirect.github.com/numpy/numpy/pull/24555))

##### A new `strict` option for several testing functions

The `strict` keyword is now available for
`numpy.testing.assert_allclose`,
`numpy.testing.assert_equal`, and `numpy.testing.assert_array_less`.
Setting
`strict=True` will disable the broadcasting behaviour for scalars and
ensure
that input arrays have the same data type.

([gh-24680](https://redirect.github.com/numpy/numpy/pull/24680),
[gh-24770](https://redirect.github.com/numpy/numpy/pull/24770),
[gh-24775](https://redirect.github.com/numpy/numpy/pull/24775))

##### Add `np.core.umath.find` and `np.core.umath.rfind` UFuncs

Add two `find` and `rfind` UFuncs that operate on unicode or byte
strings and are used in `np.char`. They operate similar to `str.find`
and `str.rfind`.

([gh-24868](https://redirect.github.com/numpy/numpy/pull/24868))

##### `diagonal` and `trace` for `numpy.linalg`

`numpy.linalg.diagonal` and `numpy.linalg.trace` have been added, which
are
array API standard-compatible variants of `numpy.diagonal` and
`numpy.trace`.
They differ in the default axis selection which define 2-D sub-arrays.

([gh-24887](https://redirect.github.com/numpy/numpy/pull/24887))

##### New `long` and `ulong` dtypes

`numpy.long` and `numpy.ulong` have been added as NumPy integers mapping
to
C's `long` and `unsigned long`. Prior to NumPy 1.24, `numpy.long` was an
alias
to Python's `int`.

([gh-24922](https://redirect.github.com/numpy/numpy/pull/24922))

##### `svdvals` for `numpy.linalg`

`numpy.linalg.svdvals` has been added. It computes singular values for
(a stack
of) matrices. Executing `np.svdvals(x)` is the same as calling
`np.svd(x,
compute_uv=False, hermitian=False)`. This function is compatible with
the array
API standard.

([gh-24940](https://redirect.github.com/numpy/numpy/pull/24940))

##### A new `isdtype` function

`numpy.isdtype` was added to provide a canonical way to classify NumPy's
dtypes in compliance with the array API standard.

([gh-25054](https://redirect.github.com/numpy/numpy/pull/25054))

##### A new `astype` function

`numpy.astype` was added to provide an array API standard-compatible
alternative to the `numpy.ndarray.astype` method.

([gh-25079](https://redirect.github.com/numpy/numpy/pull/25079))

##### Array API compatible functions' aliases

13 aliases for existing functions were added to improve compatibility
with the array API standard:

-   Trigonometry: `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`,
    `atan2`.
-   Bitwise: `bitwise_left_shift`, `bitwise_invert`,
    `bitwise_right_shift`.
-   Misc: `concat`, `permute_dims`, `pow`.
-   In `numpy.linalg`: `tensordot`, `matmul`.

([gh-25086](https://redirect.github.com/numpy/numpy/pull/25086))

##### New `unique_*` functions

The `numpy.unique_all`, `numpy.unique_counts`, `numpy.unique_inverse`,
and
`numpy.unique_values` functions have been added. They provide
functionality of
`numpy.unique` with different sets of flags. They are array API
standard-compatible, and because the number of arrays they return does
not
depend on the values of input arguments, they are easier to target for
JIT
compilation.

([gh-25088](https://redirect.github.com/numpy/numpy/pull/25088))

##### Matrix transpose support for ndarrays

NumPy now offers support for calculating the matrix transpose of an
array (or stack of arrays). The matrix transpose is equivalent to
swapping the last two axes of an array. Both `np.ndarray` and
`np.ma.MaskedArray` now expose a `.mT` attribute, and there is a
matching new `numpy.matrix_transpose` function.

([gh-23762](https://redirect.github.com/numpy/numpy/pull/23762))

##### Array API compatible functions for `numpy.linalg`

Six new functions and two aliases were added to improve compatibility
with the Array API standard for \`numpy.linalg\`:

-   `numpy.linalg.matrix_norm` - Computes the matrix norm of
    a matrix (or a stack of matrices).

-   `numpy.linalg.vector_norm` - Computes the vector norm of
    a vector (or batch of vectors).

-   `numpy.vecdot` - Computes the (vector) dot product of
    two arrays.

-   `numpy.linalg.vecdot` - An alias for
    `numpy.vecdot`.

-   `numpy.linalg.matrix_transpose` - An alias for
    `numpy.matrix_transpose`.

    ([gh-25155](https://redirect.github.com/numpy/numpy/pull/25155))

-   `numpy.linalg.outer` has been added. It computes the
    outer product of two vectors. It differs from
    `numpy.outer` by accepting one-dimensional arrays only.
    This function is compatible with the array API standard.

    ([gh-25101](https://redirect.github.com/numpy/numpy/pull/25101))

-   `numpy.linalg.cross` has been added. It computes the
    cross product of two (arrays of) 3-dimensional vectors. It differs
    from `numpy.cross` by accepting three-dimensional
    vectors only. This function is compatible with the array API
    standard.

    ([gh-25145](https://redirect.github.com/numpy/numpy/pull/25145))

##### A `correction` argument for `var` and `std`

A `correction` argument was added to `numpy.var` and `numpy.std`, which
is an
array API standard compatible alternative to `ddof`. As both arguments
serve a
similar purpose, only one of them can be provided at the same time.

([gh-25169](https://redirect.github.com/numpy/numpy/pull/25169))

##### `ndarray.device` and `ndarray.to_device`

An `ndarray.device` attribute and `ndarray.to_device` method were added
to `numpy.ndarray` for array API standard compatibility.

Additionally, `device` keyword-only arguments were added to:
`numpy.asarray`, `numpy.arange`, `numpy.empty`, `numpy.empty_like`,
`numpy.eye`, `numpy.full`, `numpy.full_like`, `numpy.linspace`,
`numpy.ones`,
`numpy.ones_like`, `numpy.zeros`, and `numpy.zeros_like`.

For all these new arguments, only `device="cpu"` is supported.

([gh-25233](https://redirect.github.com/numpy/numpy/pull/25233))

##### StringDType has been added to NumPy

We have added a new variable-width UTF-8 encoded string data type,
implementing
a "NumPy array of Python strings", including support for a user-provided
missing data sentinel. It is intended as a drop-in replacement for
arrays of
Python strings and missing data sentinels using the object dtype. See
[NEP 55](https://numpy.org/neps/nep-0055-string_dtype.html) and the
documentation
of stringdtype for more details.

([gh-25347](https://redirect.github.com/numpy/numpy/pull/25347))

##### New keywords for `cholesky` and `pinv`

The `upper` and `rtol` keywords were added to
`numpy.linalg.cholesky` and `numpy.linalg.pinv`,
respectively, to improve array API standard compatibility.

For `numpy.linalg.pinv`, if neither `rcond` nor `rtol` is
specified, the `rcond`'s default is used. We plan to deprecate and
remove `rcond` in the future.

([gh-25388](https://redirect.github.com/numpy/numpy/pull/25388))

##### New keywords for `sort`, `argsort` and `linalg.matrix_rank`

New keyword parameters were added to improve array API standard
compatibility:

-   `rtol` was added to `numpy.linalg.matrix_rank`.
-   `stable` was added to `numpy.sort` and
    `numpy.argsort`.

([gh-25437](https://redirect.github.com/numpy/numpy/pull/25437))

##### New `numpy.strings` namespace for string ufuncs

NumPy now implements some string operations as ufuncs. The old `np.char`
namespace is still available, and where possible the string manipulation
functions in that namespace have been updated to use the new ufuncs,
substantially improving their performance.

Where possible, we suggest updating code to use functions in
`np.strings` instead of `np.char`. In the future we may deprecate
`np.char` in favor of `np.strings`.

([gh-25463](https://redirect.github.com/numpy/numpy/pull/25463))

##### `numpy.fft` support for different precisions and in-place
calculations

The various FFT routines in `numpy.fft` now do their
calculations natively in float, double, or long double precision,
depending on the input precision, instead of always calculating in
double precision. Hence, the calculation will now be less precise for
single and more precise for long double precision. The data type of the
output array will now be adjusted accordingly.

Furthermore, all FFT routines have gained an `out` argument that can be
used for in-place calculations.

([gh-25536](https://redirect.github.com/numpy/numpy/pull/25536))

##### configtool and pkg-config support

A new `numpy-config` CLI script is available that can be queried for the
NumPy version and for compile flags needed to use the NumPy C API. This
will allow build systems to better support the use of NumPy as a
dependency. Also, a `numpy.pc` pkg-config file is now included with
Numpy. In order to find its location for use with `PKG_CONFIG_PATH`, use
`numpy-config --pkgconfigdir`.

([gh-25730](https://redirect.github.com/numpy/numpy/pull/25730))

##### Array API standard support in the main namespace

The main `numpy` namespace now supports the array API standard. See
`array-api-standard-compatibility` for
details.

([gh-25911](https://redirect.github.co

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Kislovskiy/talks).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM4LjU5LjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
  • Loading branch information
Kislovskiy authored Sep 22, 2024
2 parents 650adea + c7ff3b7 commit 6663cce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2023_PyData_Berlin/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy==1.26.4
numpy==2.1.1
pandas==2.2.3
matplotlib==3.9.2
pytest==8.3.3
Expand Down

0 comments on commit 6663cce

Please sign in to comment.