Release of Python library for scientific computing NumPy 2.0.0

The release of the Python library for scientific computing NumPy 2.0.0 is now available, designed for working with multidimensional arrays and matrices, and providing a large collection of functions implementing various algorithms related to matrix usage. NumPy is one of the most in-demand libraries used for scientific calculations. The project code is written in Python with optimizations in C and is distributed under the BSD license.

NumPy 2.0.0 is marked as the first significant release since 2006.
In the new version, in addition to new features and performance optimizations, there are changes to the ABI, Python API, and C API that break backward compatibility. For example, a library built with NumPy 1.x to work with NumPy 2.0 will require recompilation. In some cases, using NumPy 2.0 in applications may require code changes.

The most significant break relates to the preservation of precision in scalar expressions; for example, "np.float32(3) + 3" will now return a value with type float32 instead of float64, and in expressions with multiple types, the result will use the type with the highest precision, i.e., "np.array([3], dtype=np.float32) + np.float64(3)" will return a value of type float64. The default integer types used on Windows platforms have changed — on 64-bit systems, a 64-bit integer type is now used, and on 32-bit systems, a 32-bit type (previously a C-type long was used, now it is equivalent to np.intp).

Some definitions in the C API have been replaced or removed, for example, the structure PyArray_Descr has been modified. The maximum number of dimensions and arguments set through the macros NPY_MAXDIMS and NPY_MAXARGS has been increased to 64. All complex types have been transitioned to use standard types from the C99 specification (cfloat_t, cdouble_t, clongdouble_t). A new C API has been added for creating custom dtype. New simplified functions PyArray_ImportNumPyAPI and PyUFunc_ImportUFuncAPI have been proposed.

The Python API now provides clearer separation between public and private APIs, and a new module structure has been proposed. About 100 functions, modules, and constants have been moved out of the main namespace "np," deprecated, or removed.
The np.lib namespace has been cleaned. The number of objects in the main namespace has been reduced by 10%, and in the numpy.lib namespace by 80%. It has been relegated to the private namespaces of numpy.core. Some methods have been removed from the np.ndarray and np.generic classes. A new namespace numpy.stringsf has been created for string operations.

Notable new features include support for float32 and longdouble types in all numpy.fft functions, support for the standard Array API in the main namespace, a new namespace and types for variable-length strings. Performance optimization has been achieved using Intel x86-simd-sort and Google Highway libraries for string functions such as sort, argsort, partition, and argpartition, and fixed string operations in the numpy.char module have been accelerated. A new API has been added.
opt_func_info for tracing and introspection.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster