Skip to content

2362 skip MMAR downloading if the remote has http 500#2363

Merged
wyli merged 2 commits into
Project-MONAI:devfrom
wyli:2362-mmar-download-error
Jun 14, 2021
Merged

2362 skip MMAR downloading if the remote has http 500#2363
wyli merged 2 commits into
Project-MONAI:devfrom
wyli:2362-mmar-download-error

Conversation

@wyli

@wyli wyli commented Jun 12, 2021

Copy link
Copy Markdown
Contributor

Signed-off-by: Wenqi Li wenqil@nvidia.com

Fixes #2362

Description

skip downloading if there's a remote server error

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.

@wyli wyli requested review from Nic-Ma, ericspod and madil90 June 12, 2021 15:07

@Nic-Ma Nic-Ma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for your quick fix, I put some minor comments inline.
Others look good to me.

Thanks.

download_mmar(idx, mmar_dir=tmp_dir, progress=False) # repeated to check caching
self.assertTrue(os.path.exists(os.path.join(tmp_dir, idx)))
except (ContentTooShortError, HTTPError, RuntimeError) as e:
print(str(e))

@Nic-Ma Nic-Ma Jun 14, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add a basic test for the error message? Just like:
https://github.com/Project-MONAI/MONAI/blob/dev/tests/test_download_and_extract.py#L36

Thanks.

wyli added 2 commits June 14, 2021 17:02
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli force-pushed the 2362-mmar-download-error branch from 9dcff43 to 09d2bd7 Compare June 14, 2021 16:06
@wyli wyli enabled auto-merge (squash) June 14, 2021 16:06
@wyli wyli merged commit fe3521f into Project-MONAI:dev Jun 14, 2021
@wyli wyli deleted the 2362-mmar-download-error branch June 30, 2021 22:44
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.

nightly tests: mmar downloading

2 participants