Skip to content

Commit b25ea3e

Browse files
committed
DOC: address review comments on 2.0 release notes
[skip actions] [skip azp] [skip cirrus]
1 parent 3b5e6d8 commit b25ea3e

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

doc/source/numpy_2_0_migration_guide.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Ruff plugin
1414
Many of the changes covered in the 2.0 release notes and in this migration
1515
guide can be automatically adapted to in downstream code with a dedicated
1616
`Ruff <https://docs.astral.sh/ruff/>`__ rule, namely rule
17-
`NPY201 <https://docs.astral.sh/ruff/rules/numpy2-deprecation/>`_.
17+
`NPY201 <https://docs.astral.sh/ruff/rules/numpy2-deprecation/>`__.
1818

1919
You should install ``ruff>=0.2.0`` and add the ``NPY201`` rule to your
2020
``pyproject.toml``::
@@ -374,7 +374,7 @@ numpy.strings namespace
374374
A new `numpy.strings` namespace has been created, where most of the string
375375
operations are implemented as ufuncs. The old `numpy.char` namespace still is
376376
available, and, wherever possible, uses the new ufuncs for greater performance.
377-
We recommend using the `~numpy.strings` function going forward. The
377+
We recommend using the `~numpy.strings` functions going forward. The
378378
`~numpy.char` namespace may be deprecated in the future.
379379

380380

@@ -401,7 +401,7 @@ The :ref:`copy keyword behavior changes <copy-keyword-changes-2.0>` in
401401
``np.asarray(...)``. Older code tended to use ``np.array`` like this because
402402
it had less overhead than the default ``np.asarray`` copy-if-needed
403403
behavior. This is no longer true, and ``np.asarray`` is the preferred function.
404-
2. For code that explicitly needs to pass ``None/False`` meaning "copy if
404+
2. For code that explicitly needs to pass ``None``/``False`` meaning "copy if
405405
needed" in a way that's compatible with NumPy 1.x and 2.x, see
406406
`scipy#20172 <https://github.com/scipy/scipy/pull/20172>`__ for an example
407407
of how to do so.

doc/source/release/2.0.0-notes.rst

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,33 @@
44
NumPy 2.0.0 Release Notes
55
=========================
66

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+
715
NumPy 2.0.0 is the first major release since 2006. It is the result of X months
816
of development since the last feature release by Y contributors, and contains a
917
large amount of exciting new features as well as a large amount of changes to
1018
both the Python and C APIs.
1119

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+
1234
Highlights of this release include:
1335

1436
- New features:
@@ -20,12 +42,14 @@ Highlights of this release include:
2042

2143
- Performance improvements:
2244

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,
2648
- macOS Accelerate support and binary wheels for macOS >=14, with significant
2749
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.
2953
- A new tracing and introspection API to determine which hardware-specific
3054
kernels are available and will be dispatched to ... see
3155
`~numpy.lib.introspect.opt_func_info`
@@ -50,9 +74,14 @@ Highlights of this release include:
5074

5175
- Improved behavior:
5276

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.
5483
- 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,
5685
- The maximum number of array dimensions is changed from 32 to 64
5786

5887
- Documentation:
@@ -76,11 +105,9 @@ API and behavior improvements and better future extensibility. This price is:
76105
:ref:`numpy-2-abi-handling`.
77106
TODO: main messages.
78107

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

82110

83-
84111
NumPy 2.0 Python API removals
85112
=============================
86113

@@ -401,7 +428,17 @@ Minor changes in behavior of sorting functions
401428

402429
Due to algorithmic changes and use of SIMD code, sorting functions with methods
403430
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>`__)
405442

406443

407444
C API changes
@@ -577,7 +614,7 @@ fields must now be accessed via `PyDataType_ELSIZE`,
577614
`PyDataType_SET_ELSIZE`, and `PyDataType_ALIGNMENT`.
578615
In cases where the descriptor is attached to an array, we advise
579616
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.
581618

582619
(`gh-25943 <https://github.com/numpy/numpy/pull/25943>`__)
583620

0 commit comments

Comments
 (0)