Skip to content

enhance download_and_extract#8215

Closed
Jerome-Hsieh wants to merge 1 commit intoProject-MONAI:devfrom
Jerome-Hsieh:issue5463
Closed

enhance download_and_extract#8215
Jerome-Hsieh wants to merge 1 commit intoProject-MONAI:devfrom
Jerome-Hsieh:issue5463

Conversation

@Jerome-Hsieh
Copy link
Contributor

Fixes #5463

Description

@wyli
@KumoLiu
@ericspod

According to issue, the error messages are not very intuitive.
I think maybe we can check if the file name matches the downloaded file’s base name before starting the download.
If it doesn’t match, it will notify user.

>>> import monai
>>> url = "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/MedNIST.tar.gz"
>>> monai.apps.utils.download_and_extract(url, filepath="./test")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yuan/Desktop/OSS/MONAI/monai/apps/utils.py", line 363, in download_and_extract
    raise NotImplementedError(
NotImplementedError: The file types do not match: url=.tar.gz, but filepath=

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Jerome-Hsieh Jerome-Hsieh deleted the issue5463 branch November 16, 2024 20:13
@Jerome-Hsieh Jerome-Hsieh restored the issue5463 branch November 16, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parameter filepath of download_and_extract

1 participant