Skip to content

Commit ad4d6ee

Browse files
committed
DOC: complete the narrative section of the 2.0.0 release notes
[skip actions] [skip azp] [skip cirrus]
1 parent df44639 commit ad4d6ee

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed

doc/source/numpy_2_0_migration_guide.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ NumPy 2.0 migration guide
55
*************************
66

77
This document contains a set of instructions on how to update your code to
8-
work with Numpy 2.0.
8+
work with NumPy 2.0. It covers changes in NumPy's Python and C APIs.
9+
10+
.. note::
11+
12+
Note that NumPy 2.0 also breaks binary compatibility - if you are
13+
distributing binaries for a Python package that depends on NumPy's C API,
14+
please see :ref:`numpy-2-abi-handling`.
15+
916

1017

1118
Ruff plugin

doc/source/release/2.0.0-notes.rst

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,24 @@ Highlights of this release include:
3636
- New features:
3737

3838
- A new variable-length string dtype, `~numpy.dtypes.StringDType` and a new
39-
`numpy.strings` namespace with performant ufuncs ...
39+
`numpy.strings` namespace with performant ufuncs for string operations,
4040
- Support for ``float32`` and ``longdouble`` in all `numpy.fft` functions,
41-
- Support for the array API standard in the main ``numpy`` namespace
41+
- Support for the array API standard in the main ``numpy`` namespace.
4242

4343
- Performance improvements:
4444

4545
- Sorting functions (`sort`, `argsort`, `partition`, `argpartition`)
4646
have been accelerated through the use of the Intel x86-simd-sort and Google
4747
Highway libraries, and may see large (hardware-specific) speedups,
4848
- macOS Accelerate support and binary wheels for macOS >=14, with significant
49-
performance improvements for linear algebra operations on macOS
49+
performance improvements for linear algebra operations on macOS, and wheels
50+
that are about 3 times smaller,
5051
- `numpy.char` fixed-length string operations have been accelerated by
5152
implementing ufuncs that also support `~numpy.dtypes.StringDType` in
52-
addition to the the fixed-length string dtypes.
53-
- A new tracing and introspection API to determine which hardware-specific
54-
kernels are available and will be dispatched to ... see
55-
`~numpy.lib.introspect.opt_func_info`
53+
addition to the the fixed-length string dtypes,
54+
- A new tracing and introspection API, `~numpy.lib.introspect.opt_func_info`,
55+
to determine which hardware-specific kernels are available and will be
56+
dispatched to.
5657

5758
- Python API improvements:
5859

@@ -67,10 +68,11 @@ Highlights of this release include:
6768

6869
- C API improvements:
6970

70-
- A new public C API for creating custom dtypes
71+
- A new :ref:`public C API for creating custom dtypes <dtype-api>`,
7172
- Many outdated functions and macros removed, and private internals hidden to
7273
ease future extensibility,
73-
- New, easier to use, initialization functions,
74+
- New, easier to use, initialization functions:
75+
:c:func:`PyArray_ImportNumPyAPI` and :c:func:`PyUFunc_ImportUFuncAPI`.
7476

7577
- Improved behavior:
7678

@@ -98,12 +100,27 @@ NumPy in the future.
98100
The "no free lunch" theorem dictates that there is a price to pay for all these
99101
API and behavior improvements and better future extensibility. This price is:
100102

101-
1. Backwards compatibility - clear errors in most cases; see the Deprecation
102-
and Compatibility sections below, and the :ref:`numpy-2-migration-guide`
103-
(note: there is a ``ruff`` mode to auto-fix many things in Python code)
104-
2. ABI change - impact on downstream libraries and binaries. See
105-
:ref:`numpy-2-abi-handling`.
106-
TODO: main messages.
103+
1. Backwards compatibility. There are a significant number of breaking changes
104+
to both the Python and C APIs. In the majority of cases, there are clear
105+
error messages that will inform the user how to adapt their code. However,
106+
there are also changes in behavior for which it was not possible to give
107+
such an error message - these cases are all covered in the Deprecation and
108+
Compatibility sections below, and in the :ref:`numpy-2-migration-guide`.
109+
110+
Note that there is a ``ruff`` mode to auto-fix many things in Python code.
111+
112+
2. Breaking changes to the NumPy ABI. As a result, binaries of packages that
113+
use the NumPy C API and were built against a NumPy 1.xx release will not
114+
work with NumPy 2.0. On import, such packages will see an ``ImportError``
115+
with a message about binary incompatibiliy.
116+
117+
It is possible to build binaries against NumPy 2.0 that will work at runtime
118+
with both NumPy 2.0 and 1.x. See :ref:`numpy-2-abi-handling` for more details.
119+
120+
**All downstream packages that depend on the NumPy ABI are advised to do a
121+
new release built against NumPy 2.0 and verify that that release works with
122+
both 2.0 and 1.26 - ideally in the period between 2.0.0rc1 (which will be
123+
ABI-stable) and the final 2.0.0 release to avoid problems for their users.**
107124

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

0 commit comments

Comments
 (0)