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

fixed RawNodeTransformer to resolve names of files hosted on zenodo properly #548

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

k-dominik
Copy link
Member

@k-dominik k-dominik commented Jan 16, 2024

Background - in ilastik we use get_resource_package_content to get the list of files for a given model. See #547 for more background.

Filenames would currently be resolved to "content", "content-0" and so on in case of multiple such files. Previously one could get the filenames in the keys.
Some functionality relies on at least having the file extensions, which currently would be omitted.

With this PR, the original filenames are restored by removing the "/content" bit from the zenodo urls.

get_resource_package_content resolves filenames correctly with this patch:

output of get_resource_package_content (abbreviated)
'cover.png': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/cover.png/content', query='', fragment=''),
 'documentation.md': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/documentation.md/content', query='', fragment=''),
 'rdf.yaml': ...,
 'sample_input_0.tif': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/sample_input_0.tif/content', query='', fragment=''),
 'sample_output_0.tif': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/sample_output_0.tif/content', query='', fragment=''),
 'test_input_0.npy': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/test_input_0.npy/content', query='', fragment=''),
 'test_output_0.npy': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/test_output_0.npy/content', query='', fragment=''),
 'unet.py': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/unet.py/content', query='', fragment=''),
 'weights-torchscript.pt': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/weights-torchscript.pt/content', query='', fragment=''),
 'weights.pt': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/weights.pt/content', query='', fragment=''),
 'zero_mean_unit_variance.ijm': URI(uri_string=None, scheme='https', authority='zenodo.org', path='/api/records/5874742/files/zero_mean_unit_variance.ijm/content', query='', fragment='')}

fixes #547

these would previously be resolved to "content", "content-0" and so on
in case of multiple such files.
Some functionality relies on file extensions which would be omitted.
The original filenames are restored by removing the "/content" bit from
the zenodo urls.
@github-actions github-actions bot added the bug Something isn't working label Jan 16, 2024
@FynnBe FynnBe merged commit 0dd0de7 into main Jan 23, 2024
7 checks passed
@FynnBe FynnBe deleted the fix-filenames-zenodo branch January 23, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_resource_package_content doesn't properly resolve filenames
2 participants