Skip to content

Align with numpy 2.5#137

Open
antonwolfy wants to merge 3 commits into
masterfrom
align-with-numpy-2.5
Open

Align with numpy 2.5#137
antonwolfy wants to merge 3 commits into
masterfrom
align-with-numpy-2.5

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

NumPy 2.5 introduced two deprecations that broke the mkl_random test suite (2 failures, plus deprecation warnings emitted across many tests). This PR resolves both:

  • In-place array shape assignment — NumPy 2.5 deprecated setting arr.shape = (...) in place. Replaced all such sites in mkl_random/mklrand.pyx with the equivalent arr.reshape((...)). The affected arrays are freshly-allocated C-contiguous buffers, so reshape returns a view (no copy) and behavior is unchanged. np.reshape(..., copy=False) was intentionally avoided since the package supports numpy >=1.26.4 and the copy kwarg only landed in NumPy 2.1.

  • numpy.testing.suppress_warnings — deprecated in NumPy 2.4. Replaced the two usages in mkl_random/tests/test_random.py with pytest.warns(DeprecationWarning) and removed the now-unused import. The tests still assert that random_integers emits a DeprecationWarning.

@antonwolfy antonwolfy added this to the 1.5.0 release milestone Jun 24, 2026
@antonwolfy antonwolfy self-assigned this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant