Sign In

numpy

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numpy - pypi Package Compare versions

Comparing version
2.4.3
to
2.4.4
+29
doc/changelog/2.4.4-changelog.rst
Contributors
============
A total of 8 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
* Charles Harris
* Daniel Haag +
* Denis Prokopenko +
* Harshith J +
* Koki Watanabe
* Marten van Kerkwijk
* Matti Picus
* Nathan Goldbaum
Pull requests merged
====================
A total of 7 pull requests were merged for this release.
* `#30978 <https://github.com/numpy/numpy/pull/30978>`__: MAINT: Prepare 2.4.x for further development
* `#31049 <https://github.com/numpy/numpy/pull/31049>`__: BUG: Add test to reproduce problem described in #30816 (#30818)
* `#31052 <https://github.com/numpy/numpy/pull/31052>`__: BUG: fix FNV-1a 64-bit selection by using NPY_SIZEOF_UINTP (#31035)
* `#31053 <https://github.com/numpy/numpy/pull/31053>`__: BUG: avoid warning on ufunc with where=True and no output
* `#31058 <https://github.com/numpy/numpy/pull/31058>`__: DOC: document caveats of ndarray.resize on 3.14 and newer
* `#31079 <https://github.com/numpy/numpy/pull/31079>`__: TST: fix POWER VSX feature mapping (#30801)
* `#31084 <https://github.com/numpy/numpy/pull/31084>`__: MAINT: numpy.i: Replace deprecated ``sprintf`` with ``snprintf``...
.. currentmodule:: numpy
=========================
NumPy 2.4.4 Release Notes
=========================
The NumPy 2.4.3 is a patch release that fixes bugs discovered after the 2.4.2
release. It should finally close issue #30816, the OpenBLAS threading problem
on ARM.
This release supports Python versions 3.11-3.14
Contributors
============
A total of 8 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.
* Charles Harris
* Daniel Haag +
* Denis Prokopenko +
* Harshith J +
* Koki Watanabe
* Marten van Kerkwijk
* Matti Picus
* Nathan Goldbaum
Pull requests merged
====================
A total of 7 pull requests were merged for this release.
* `#30978 <https://github.com/numpy/numpy/pull/30978>`__: MAINT: Prepare 2.4.x for further development
* `#31049 <https://github.com/numpy/numpy/pull/31049>`__: BUG: Add test to reproduce problem described in #30816 (#30818)
* `#31052 <https://github.com/numpy/numpy/pull/31052>`__: BUG: fix FNV-1a 64-bit selection by using NPY_SIZEOF_UINTP (#31035)
* `#31053 <https://github.com/numpy/numpy/pull/31053>`__: BUG: avoid warning on ufunc with where=True and no output
* `#31058 <https://github.com/numpy/numpy/pull/31058>`__: DOC: document caveats of ndarray.resize on 3.14 and newer
* `#31079 <https://github.com/numpy/numpy/pull/31079>`__: TST: fix POWER VSX feature mapping (#30801)
* `#31084 <https://github.com/numpy/numpy/pull/31084>`__: MAINT: numpy.i: Replace deprecated ``sprintf`` with ``snprintf``...
+1
-0

@@ -8,2 +8,3 @@ *************

2.4.4 <release/2.4.4-notes>
2.4.3 <release/2.4.3-notes>

@@ -10,0 +11,0 @@ 2.4.2 <release/2.4.2-notes>

+4
-3

@@ -75,3 +75,4 @@ /*

* Compute a size_t FNV-1a hash of the given data
* This will use 32-bit or 64-bit hash depending on the size of size_t
* This will use 32-bit or 64-bit hash depending on the size of npy_uintp.
* npy_uintp has the same size as size_t.
*/

@@ -81,7 +82,7 @@ size_t

{
#if NPY_SIZEOF_SIZE_T == 8
#if NPY_SIZEOF_UINTP == 8
return (size_t)npy_fnv1a_64(buf, len, FNV1A_64_INIT);
#else /* NPY_SIZEOF_SIZE_T == 4 */
#else /* NPY_SIZEOF_UINTP == 4 */
return (size_t)npy_fnv1a_32(buf, len, FNV1A_32_INIT);
#endif
}

@@ -80,8 +80,10 @@ #define NPY_NO_DEPRECATED_API NPY_API_VERSION

static const char *msg =
"cannot resize an array that references or is referenced\n"
"by another object in this way.\n"
"Use the np.resize function to get a new resized copy or\n "
"set refcheck=False to disable this check";
if (PyArray_BASE(self) != NULL
|| (((PyArrayObject_fields *)self)->weakreflist != NULL)) {
PyErr_SetString(PyExc_ValueError,
"cannot resize an array that "
"references or is referenced\n"
"by another array in this way. Use the np.resize function.");
PyErr_SetString(PyExc_ValueError, msg);
return -1;

@@ -97,12 +99,23 @@ }

#if PY_VERSION_HEX >= 0x030E00B0
// Python 3.14 changed reference counting semantics for function-
// local variables. There is no way to tell if the calling function
// has been optimized (because it might be implemented in C or Cython)
//
// Instead, warn if the refcount is exactly 2 that this might be a
// false positive
if (!PyUnstable_Object_IsUniquelyReferenced((PyObject *)self)) {
if (Py_REFCNT(self) == 2) {
PyErr_SetString(
PyExc_ValueError,
"cannot resize an array that may be referenced "
"by another object.\n"
"It is possible that this is a false positive.\n"
"If you are sure that the array is uniquely referenced, "
"set refcheck=False.");
return -1;
}
#else
if (Py_REFCNT(self) > 2) {
#endif
PyErr_SetString(
PyExc_ValueError,
"cannot resize an array that "
"references or is referenced\n"
"by another array in this way.\n"
"Use the np.resize function or refcheck=False");
PyErr_SetString(PyExc_ValueError, msg);
return -1;

@@ -187,2 +200,8 @@ }

* weak-references and no base object.
*
* On Python 3.13 and older, the check allows objects with exactly one
* reference to be reallocated in-place. On Python 3.14 and newer, the array
* must be uniquely referenced. In some cases this can lead to spurious
* ValueErrors.
*
*/

@@ -189,0 +208,0 @@ NPY_NO_EXPORT PyObject *

@@ -7,2 +7,3 @@ #cython: language_level=3

"""
import numpy as np
cimport numpy as cnp

@@ -376,1 +377,7 @@ cnp.import_array()

return cnp.NPY_UINTP > 0
def resize_refcheck_test():
# see gh-30991
a = np.array([[0, 1], [2, 3]], order='C')
a.resize((2, 1))

@@ -381,8 +381,40 @@ import os

features = ["VSX", "VSX2", "VSX3", "VSX4"]
features_map = {"VSX2": "ARCH_2_07", "VSX3": "ARCH_3_00", "VSX4": "ARCH_3_1"}
features_map = {
"VSX": "ARCH_2_06",
"VSX2": "ARCH_2_07",
"VSX3": "ARCH_3_00",
"VSX4": "ARCH_3_1B"
}
def load_flags(self):
self.load_flags_auxv()
platform = self._get_platform()
if platform:
power_match = re.search(r'power(\d+)', platform, re.IGNORECASE)
if power_match:
power_gen = int(power_match.group(1))
if power_gen >= 7:
self.features_flags.add("ARCH_2_06")
if power_gen >= 8:
self.features_flags.add("ARCH_2_07")
if power_gen >= 9:
self.features_flags.add("ARCH_3_00")
if power_gen >= 10:
self.features_flags.add("ARCH_3_1B")
def _get_platform(self):
"""Get the AT_PLATFORM value from AUXV"""
try:
auxv = subprocess.check_output(['/bin/true'], env={"LD_SHOW_AUXV": "1"})
for line in auxv.split(b'\n'):
if line.startswith(b'AT_PLATFORM'):
parts = line.split(b':', 1)
if len(parts) == 2:
return parts[1].strip().decode().lower()
except Exception:
pass
return None
is_zarch = re.match(r"^(s390x)", machine, re.IGNORECASE)

@@ -389,0 +421,0 @@ @pytest.mark.skipif(not is_linux or not is_zarch,

@@ -353,1 +353,16 @@ import os

assert checks.check_npy_uintp_type_enum()
@pytest.mark.skipif(
sys.version_info < (3, 14),
reason="Tests behavior that happens on Python 3.14 and newer"
)
@pytest.mark.skipif(
sysconfig.get_platform() == 'win-arm64',
reason='no checks module on win-arm64'
)
def test_resize_refcheck(install_temp):
import checks
msg = "It is possible that this is a false positive."
with pytest.raises(ValueError, match=msg):
checks.resize_refcheck_test()

@@ -10,2 +10,3 @@ """ Test functions for linalg module

assert_,
assert_almost_equal,
assert_array_almost_equal,

@@ -184,1 +185,8 @@ assert_array_equal,

"probably due to OpenBLAS threading issues")
def test_norm_linux_arm(self):
# gh-30816
a = np.arange(20000) / 50000
b = a + 1j * np.roll(np.flip(a), 12345)
norm = np.linalg.norm(b)
assert_almost_equal(norm, 46.18628948075393)

@@ -5,8 +5,8 @@

"""
version = "2.4.3"
version = "2.4.4"
__version__ = version
full_version = version
git_revision = "8bcb2e72e67c343e55165e6064fe6a9dc011e954"
git_revision = "be93fe2960dbf49b4647f5783c66d967fb2c65b5"
release = 'dev' not in version and '+' not in version
short_version = version.split("+")[0]
Metadata-Version: 2.4
Name: numpy
Version: 2.4.3
Version: 2.4.4
Summary: Fundamental package for array computing in Python

@@ -5,0 +5,0 @@ Author: Travis E. Oliphant et al.

@@ -10,3 +10,3 @@ [build-system]

name = "numpy"
version = "2.4.3"
version = "2.4.4"
description = "Fundamental package for array computing in Python"

@@ -13,0 +13,0 @@ authors = [{name = "Travis E. Oliphant et al."}]

spin
# Keep this in sync with ci32_requirements.txt
scipy-openblas32==0.3.31.126.1
scipy-openblas64==0.3.31.126.1
scipy-openblas32==0.3.31.188.0
scipy-openblas64==0.3.31.188.0
spin
# Keep this in sync with ci_requirements.txt
scipy-openblas32==0.3.31.126.1
scipy-openblas32==0.3.31.188.0

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet