-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
CI/FIX Enable numpy dev in [scipy-dev] build and fix Bayesian linear models for numpy 2 compat #27899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI/FIX Enable numpy dev in [scipy-dev] build and fix Bayesian linear models for numpy 2 compat #27899
Conversation
|
Good news. Most scikit-learn tests pass (thanks to the fixes contributed earlier by @seberg). We just need to fix a test with unexpected dtype values. I suspect the changes in dtype promotion rules: https://numpy.org/neps/nep-0050-scalar-promotion.html. I will have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. If the fix is simply in a test, I could imagine to add it inside this PR as well.
Not it's not just the test. The dtype of some fitted attribute is upcasted. I have a fix, I will push to the PR and update the title. |
|
I milestoned this PR 1.4 so that scikit-learn would not have any numpy 2 incompatible code in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It seems like float32<
8000
/code> dtype was maintained in numpy<2 by relying on float64_scalar * float32_array => float32_array (try executing np.float64(1.) * np.ones(2, dtype=np.float32) if you want to double-check)
The code in this PR is more careful about dtype.
|
And also it seems like |
While reviewing #27075, I realized that the current state of our
Linux_Nightlypylatest_pip_scipy_devdoes not actually test against numpy dev without us upper-bounding the version of numpy explicitly (yet):https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=61365&view=logs&j=dfe99b15-50db-5d7b-b1e9-4105c42527cf&t=eb5122d5-ab7e-5479-a8ce-245b4d64938b&l=442
The goal of this PR is to trigger a run to: