Closed renovate[bot] closed 4 months ago
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR contains the following updates:
==1.26.4
->==2.0.0
Release Notes
numpy/numpy (numpy)
### [`v2.0.0`](https://togithub.com/numpy/numpy/releases/tag/v2.0.0) [Compare Source](https://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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(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 is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.