Skip to content
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 Update lock files for main CI build(s) 🔒 🤖 #30438

Merged

Conversation

scikit-learn-bot
Copy link
Contributor

Update lock files.

Note

If the CI tasks fail, create a new branch based on this PR and add the required fixes to that branch.

Copy link

github-actions bot commented Dec 9, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 0c1088d. Link to the linter CI: here

@ogrisel
Copy link
Member

ogrisel commented Dec 9, 2024

The failure is caused by a change in the output in the HDBSCAN output:

______________ [doctest] sklearn.cluster._hdbscan.hdbscan.HDBSCAN ______________
[gw0] linux -- Python 3.13.1 /usr/share/miniconda/envs/testvenv/bin/python
627 
628 Examples
629 --------
630 >>> from sklearn.cluster import HDBSCAN
631 >>> from sklearn.datasets import load_digits
632 >>> X, _ = load_digits(return_X_y=True)
633 >>> hdb = HDBSCAN(min_cluster_size=20)
634 >>> hdb.fit(X)
635 HDBSCAN(min_cluster_size=20)
636 >>> hdb.labels_
Expected:
    array([ 2,  6, -1, ..., -1, -1, -1])
Got:
    array([ 2,  6, -1, ..., -1, -1, -1], shape=(1797,))

This is caused by a change in the repr of numpy arrays after the upgrade to numpy 2.2.0:

https://numpy.org/devdocs/release/2.2.0-notes.html#changes

Personally, I like the fact that the shape is displayed by default. However, this will make the doctest difficult to work with both old and new versions numpy.

I will try to update this doctest to make it not rely on the repr of the labels_ array anymore.

@ogrisel
Copy link
Member

ogrisel commented Dec 9, 2024

I pushed 0c1088d. Please let me know what you think about it. If we merge this, we might want to cherry-pick that commit for the 1.6.X branch.

@ogrisel
Copy link
Member

ogrisel commented Dec 9, 2024

Since I pushed 0c1088d into this PR, I'll wait for others to review instead of directly merging as usual.

@lesteve
Copy link
Member

lesteve commented Dec 9, 2024

The work-around seems fine to me. Maybe using ... could work.

However, this will make the doctest difficult to work with both old and new versions

The approach we have taken historically is to only run the doctests in some settings, for example we could only run them in numpy >= 2.2.0.

@lesteve lesteve merged commit 66270e4 into scikit-learn:main Dec 9, 2024
30 checks passed
stefanogaspari pushed a commit to stefanogaspari/scikit-learn that referenced this pull request Dec 9, 2024
virchan pushed a commit to virchan/scikit-learn that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants