Skip to content

MAINT modify import raccoon face for SciPy >= 1.10 #24521

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

Merged
merged 11 commits into from
Sep 29, 2022

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Sep 27, 2022

Towards fixing #24424 (the "Test Collection Failure" item in particular).

Modify the import of the raccoon face depending on the version of SciPy.

This is only visible on the scipy-dev CI.

I also rename the variable face to raccoon_face since it will override the function itself.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LGTM. The new explicit variable name is better.

Let's wait for the CI to complete to check that the test_image module can collect and pass as expected.

@ogrisel
Copy link
Member

ogrisel commented Sep 27, 2022

Actually the is a new dependency on pooch to fetch the raccoon face:

ImportError: Missing optional dependency 'pooch' required for scipy.datasets module. Please use pip or conda to install 'pooch'.

We should pytest.importorskip("pooch") in this test and add it to one or two CI entries.

@glemaitre
Copy link
Member Author

I added pooch to some of the CI builds and to the documentation and updated the lock files.

from scipy import misc
if sp_version.release >= parse_version("1.10").release:
pytest.importorskip("pooch")
from scipy.datasets import face as raccoon_face
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only be covered by the nightly test or once 1.10 is released.

def raccoon_face():
if sp_version.release >= parse_version("1.10").release:
pytest.importorskip("pooch")
from scipy.datasets import face
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan thomasjpfan merged commit d2c713b into scikit-learn:main Sep 29, 2022
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Oct 31, 2022
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.

3 participants