|
4 | 4 | NumPy 2.0.0 Release Notes
|
5 | 5 | =========================
|
6 | 6 |
|
| 7 | +NumPy 2.0.0 is the first major release since 2006. It is the result of X months |
| 8 | +of development since the last feature release by Y contributors, and contains a |
| 9 | +large amount of exciting new features as well as a large amount of changes to |
| 10 | +both the Python and C APIs. |
| 11 | + |
| 12 | +Highlights of this release include: |
| 13 | + |
| 14 | +- New features: |
| 15 | + |
| 16 | + - A new variable-length string dtype, `~numpy.dtypes.StringDType` and a new |
| 17 | + `numpy.strings` namespace with performant ufuncs ... |
| 18 | + - Support for ``float32`` and ``longdouble`` in all `numpy.fft` functions, |
| 19 | + - Support for the array API standard in the main ``numpy`` namespace |
| 20 | + |
| 21 | +- Performance improvements: |
| 22 | + |
| 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, |
| 26 | + - macOS Accelerate support and binary wheels for macOS >=14, with significant |
| 27 | + performance improvements for linear algebra operations on macOS |
| 28 | + - `numpy.char` fixed-length string dtypes have been accelerated, ... |
| 29 | + - A new tracing and introspection API to determine which hardware-specific |
| 30 | + kernels are available and will be dispatched to ... see |
| 31 | + `~numpy.lib.introspect.opt_func_info` |
| 32 | + |
| 33 | +- Python API improvements: |
| 34 | + |
| 35 | + - A clear split between public and private API, with a new |
| 36 | + :ref:`module structure <module-structure>`, and each public function now |
| 37 | + available in a single place, |
| 38 | + - Many removals of non-recommended functions and aliases. This should make |
| 39 | + it easier to learn and use NumPy. The number of objects in the main |
| 40 | + namespace decreased by ~10% and in ``numpy.lib`` by ~80%, |
| 41 | + - :ref:`Canonical dtype names <canonical-python-and-c-types>` and a new |
| 42 | + `~numpy.isdtype` introspection function, |
| 43 | + |
| 44 | +- C API improvements: |
| 45 | + |
| 46 | + - A new public C API for creating custom dtypes |
| 47 | + - Many outdated functions and macros removed, and private internals hidden to |
| 48 | + ease future extensibility, |
| 49 | + - New, easier to use, initialization functions, |
| 50 | + |
| 51 | +- Improved behavior: |
| 52 | + |
| 53 | + - Improvements to type promotion behavior (NEP 50) ... |
| 54 | + - The default integer type on Windows is now ``int64`` rather than ``int32``, |
| 55 | + matching the behavior on other platform, |
| 56 | + - The maximum number of array dimensions is changed from 32 to 64 |
| 57 | + |
| 58 | +- Documentation: |
| 59 | + |
| 60 | + - The reference guide navigation was signficantly improved, and there is now |
| 61 | + documentation on NumPy's :ref:`module structure <module-structure>`, |
| 62 | + - The :ref:`building from source <building-from-source>` documentation was |
| 63 | + completely rewritten, |
| 64 | + |
| 65 | +Furthermore there are many changes to NumPy internals, including continuing to |
| 66 | +migrate code from C to C++, that will make it easier to improve and maintain |
| 67 | +NumPy in the future. |
| 68 | + |
| 69 | +The "no free lunch" theorem dictates that there is a price to pay for all these |
| 70 | +API and behavior improvements and better future extensibility. This price is: |
| 71 | + |
| 72 | +1. Backwards compatibility - clear errors in most cases; see the Deprecation |
| 73 | + and Compatibility sections below, and the :ref:`numpy-2-migration-guide` |
| 74 | + (note: there is a ``ruff`` mode to auto-fix many things in Python code) |
| 75 | +2. ABI change - impact on downstream libraries and binaries. See |
| 76 | + :ref:`numpy-2-abi-handling`. |
| 77 | + TODO: main messages. |
| 78 | + |
| 79 | + |
| 80 | +The Python versions supported by this release are 3.9-3.12. |
| 81 | + |
| 82 | + |
7 | 83 |
|
8 | 84 | NumPy 2.0 Python API removals
|
9 | 85 | =============================
|
|
0 commit comments