v2.5.2
Breaking Changes📦 numpyView on GitHub →
⚠ 1 breaking✨ 1 features🐛 22 fixes🔧 6 symbols
Summary
NumPy 2.5.2 is a patch release fixing bugs and including wheels for Python 3.15.0rc1. A notable C API change makes `PyArray_StringDTypeObject` opaque under the abi3t stable ABI.
⚠️ Breaking Changes
- The `PyArray_StringDTypeObject` is now an opaque struct when targeting the free-threading-compatible stable ABI (Py_TARGET_ABI3T). Extensions compiled with this ABI that accessed fields of `PyArray_StringDTypeObject` will crash. To fix this, use the `NpyString` allocator API by passing the descriptor object pointer, e.g., `NpyString_acquire_allocator((PyArray_StringDTypeObject *)descr)`.
Migration Steps
- If you are using the stable ABI (Py_TARGET_ABI3T) and accessing fields of `PyArray_StringDTypeObject`, update your code to use the `NpyString` allocator API by passing the descriptor object pointer, e.g., `NpyString_acquire_allocator((PyArray_StringDTypeObject *)descr)`.
✨ New Features
- Wheels for Python 3.15.0rc1 are now included.
🐛 Bug Fixes
- Fixed `StringDType` coerce flag in binary ufunc promotion.
- Fixed meson deprecation warnings.
- Removed obsolete string to bool workarounds.
- Centralized helper for output coerce and na_object in stringdtype.
- Fixed CPU feature env diagnostic buffer overruns.
- Restored `ndarray.conjugate()` for legacy user-defined dtypes.
- Fixed refcount leak on overlapping copyto with where=False.
- Fixed swallowed cast error in fancy indexing assignment.
- Fixed buffered iterator stride after removing multi-index.
- Fixed `np.fromiter` corruption when reusing a `StringDType`.
- Added a special case for `StringDType` in `np.isdtype`.
- Fixed reference leak in `simd_sequence_from_iterable`.
- Ensured lock is held when accessing or writing to RNG state.
- Fully reset cached RNG state for non-MT19937 RNGs.
- Avoided possible stack overflow in `arraydescr_dealloc`.
- Fixed `isclose` shape-typing for 2d array-likes.
- Avoided segfaults when legacy copyswap slot is not defined.
- Fixed crash on 32-bit systems using abi3t.
- Backported multiple static typing fixes.
- Backported multiple typing fixes.
- Avoided shadowed dtype annotations.
- Fixed `StringDType` coerce flag in binary ufunc promotion.