4
4
NumPy 2.0.0 Release Notes
5
5
=========================
6
6
7
+ .. note ::
8
+
9
+ The release of 2.0 is in progress and the current release overview and
10
+ highlights are still in a draft state. However, the highlights should
11
+ already list the most significant changes detailed in the full notes below,
12
+ and those full notes should be complete (if not copy-edited well enough
13
+ yet).
14
+
7
15
NumPy 2.0.0 is the first major release since 2006. It is the result of X months
8
16
of development since the last feature release by Y contributors, and contains a
9
17
large amount of exciting new features as well as a large amount of changes to
10
18
both the Python and C APIs.
11
19
20
+ This major release includes breaking changes that could not happen in a regular
21
+ minor (feature) release - including an ABI break, changes to type promotion
22
+ rules, and API changes which may not have been emitting deprecation warnings
23
+ in 1.26.x. Key documents related to how to adapt to changes in NumPy 2.0, in
24
+ addition to these release notes, include:
25
+
26
+ - The :ref: `numpy-2-migration-guide `
27
+ - The :ref: `NumPy 2.0-specific advice <numpy-2-abi-handling >` in
28
+ :ref: `for-downstream-package-authors `
29
+
30
+
31
+ Highlights
32
+ ==========
33
+
12
34
Highlights of this release include:
13
35
14
36
- New features:
@@ -20,12 +42,14 @@ Highlights of this release include:
20
42
21
43
- Performance improvements:
22
44
23
- - Sorting functions (`sort `, `argsort `, `partition `)
24
- have been accelerated through use of SIMD kernels and Highway, and may
25
- see large (hardware-specific) speedups,
45
+ - Sorting functions (`sort `, `argsort `, `partition `, ` argpartition ` )
46
+ have been accelerated through the use of the Intel x86-simd-sort and Google
47
+ Highway libraries, and may see large (hardware-specific) speedups,
26
48
- macOS Accelerate support and binary wheels for macOS >=14, with significant
27
49
performance improvements for linear algebra operations on macOS
28
- - `numpy.char ` fixed-length string dtypes have been accelerated, ...
50
+ - `numpy.char ` fixed-length string operations have been accelerated by
51
+ implementing ufuncs that also support `~numpy.dtypes.StringDType ` in
52
+ addition to the the fixed-length string dtypes.
29
53
- A new tracing and introspection API to determine which hardware-specific
30
54
kernels are available and will be dispatched to ... see
31
55
`~numpy.lib.introspect.opt_func_info `
@@ -50,9 +74,14 @@ Highlights of this release include:
50
74
51
75
- Improved behavior:
52
76
53
- - Improvements to type promotion behavior (NEP 50) ...
77
+ - Improvements to type promotion behavior was changed by adopting `NEP
78
+ 50 <NEP50> `_. This fixes many user surprises about promotions which
79
+ previously often depended on data values of input arrays rather than only
80
+ their dtypes. Please see the NEP and the :ref: `numpy-2-migration-guide `
81
+ for details as this change can lead to changes in output dtypes and lower
82
+ precision results for mixed-dtype operations.
54
83
- The default integer type on Windows is now ``int64 `` rather than ``int32 ``,
55
- matching the behavior on other platform ,
84
+ matching the behavior on other platforms ,
56
85
- The maximum number of array dimensions is changed from 32 to 64
57
86
58
87
- Documentation:
@@ -76,11 +105,9 @@ API and behavior improvements and better future extensibility. This price is:
76
105
:ref: `numpy-2-abi-handling `.
77
106
TODO: main messages.
78
107
79
-
80
108
The Python versions supported by this release are 3.9-3.12.
81
109
82
110
83
-
84
111
NumPy 2.0 Python API removals
85
112
=============================
86
113
@@ -401,7 +428,17 @@ Minor changes in behavior of sorting functions
401
428
402
429
Due to algorithmic changes and use of SIMD code, sorting functions with methods
403
430
that aren't stable may return slightly different results in 2.0.0 compared to
404
- 1.26.x. This includes the default method of `~numpy.sort ` and `~numpy.argsort `.
431
+ 1.26.x. This includes the default method of `~numpy.argsort ` and
432
+ `~numpy.argpartition `.
433
+
434
+ Removed ambiguity when broadcasting in ``np.solve ``
435
+ ---------------------------------------------------
436
+ The broadcasting rules for ``np.solve(a, b) `` were ambiguous when ``b `` had 1
437
+ fewer dimensions than ``a ``. This has been resolved in a backward-incompatible
438
+ way and is now compliant with the Array API. The old behaviour can be
439
+ reconstructed by using ``np.solve(a, b[..., None])[..., 0] ``.
440
+
441
+ (`gh-25914 <https://github.com/numpy/numpy/pull/25914 >`__)
405
442
406
443
407
444
C API changes
@@ -577,7 +614,7 @@ fields must now be accessed via `PyDataType_ELSIZE`,
577
614
`PyDataType_SET_ELSIZE `, and `PyDataType_ALIGNMENT `.
578
615
In cases where the descriptor is attached to an array, we advise
579
616
using ``PyArray_ITEMSIZE `` as it exists on all NumPy versions.
580
- Please see :ref: `_migration_c_descr ` for more information.
617
+ Please see :ref: `migration_c_descr ` for more information.
581
618
582
619
(`gh-25943 <https://github.com/numpy/numpy/pull/25943 >`__)
583
620
0 commit comments