You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does this implement/fix? Explain your changes.
Scikit-learn suppresses DeprecationWarnings, but in downstream examples in scikit-learn-intelex we run examples with -W error to keep user-facing examples clean. With numpy 2.5+, setting shape on numpy array was deprecated. Simplest reproducer (py3.12+):
pip install scikit-learn==1.9.0 numpy==2.5.2
python -W error -c "from sklearn.datasets import load_digits; load_digits()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/mnt/cached_oses/eglaser/miniforge3/envs/sklearn_bug/lib/python3.12/site-packages/sklearn/utils/_param_validation.py", line 218, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/cached_oses/eglaser/miniforge3/envs/sklearn_bug/lib/python3.12/site-packages/sklearn/datasets/_base.py", line 1007, in load_digits
images.shape = (-1, 8, 8)
^^^^^^^^^^^^
DeprecationWarning: Setting the shape on a NumPy array has been deprecated in NumPy 2.5.
As an alternative, you can create a new view using np.reshape (with copy=False if needed).
The pull request addresses an existing issue that is ready for contribution (e.g. not tagged as 'Needs Triage', 'Needs Decision', ...). If you are proposing a new feature, please open an issue to discuss it first.
There are no other open pull requests already targeting the same issue.
You have followed the pull request checklist. In particular, linting and tests should pass.
ethanglaser
changed the title
Address setting np array shape DeprecationWarnings
MNT Address setting np array shape DeprecationWarnings
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
N/A
What does this implement/fix? Explain your changes.
Scikit-learn suppresses DeprecationWarnings, but in downstream examples in scikit-learn-intelex we run examples with
-W errorto keep user-facing examples clean. With numpy 2.5+, setting shape on numpy array was deprecated. Simplest reproducer (py3.12+):First time contributor introduction
I am a developer working on https://github.com/uxlfoundation/scikit-learn-intelex
AI usage disclosure
I used AI assistance for:
Any other comments?
N/A