Skip to content

Fix data fetcher URL - #7872

Closed
stefanv wants to merge 16 commits into
scikit-image:mainfrom
stefanv:fix-data-fetcher-url
Closed

stefanv wants to merge 16 commits into
scikit-image:mainfrom
stefanv:fix-data-fetcher-url

Conversation

@stefanv

@stefanv stefanv commented Aug 15, 2025

Copy link
Copy Markdown
Member

No description provided.

@lagru lagru added the 🔧 type: Maintenance Refactoring and maintenance of internals label Aug 15, 2025
@mkcor

mkcor commented Aug 15, 2025

Copy link
Copy Markdown
Member

Oh, we need to update more paths... We have sample datasets in the tests as well, which got moved around! For example:

http_error_msg = '404 Client Error: Not Found for url: https://github.com/scikit-image/scikit-image/raw/main/src/skimage/color/tests/data/lab_array_a_2.npy'

@stefanv

stefanv commented Aug 15, 2025

Copy link
Copy Markdown
Member Author

Feel free to push to this branch!

@mkcor

mkcor commented Aug 15, 2025

Copy link
Copy Markdown
Member

Still need to update the fetch and _fetch functions.

@mkcor

mkcor commented Aug 15, 2025

Copy link
Copy Markdown
Member

This change 9bb2e61 makes it work for data files which are not found in src/skimage/data, hence the error Failed to download 'rank_filter_tests.npz' now. These still need the src/skimage path.

We need to handle both cases separately; right now the logic in download_all seems a bit convoluted and off-putting to me... Actually:

# Consider moving this kind of logic to Pooch
My preference would be to replace the download_all call with two calls: one to download the files living in src/skimage/data and another one to download those living (or symlinked) in tests/skimage/<submodule>.

@Czaki

Czaki commented Aug 15, 2025

Copy link
Copy Markdown
Contributor

Why not change the logic to

if os.path.exists(path_to_data_if_in_tests):
    return path_to_data_if_in_tests

# here do fetch assuming that data are in src. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants