Skip to content

Commit

Permalink
Minor fix to check for zipfile (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
anwai98 authored Dec 14, 2024
1 parent 082698f commit 7517563
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion torch_em/data/datasets/histopathology/cpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def get_cpm_data(
)

os.makedirs(path, exist_ok=True)
zip_path = glob(os.path.join(path, f"{data_choice}*.zip"))[0]
zip_path = glob(os.path.join(path, f"{data_choice}*.zip"))
if len(zip_path) == 0:
raise AssertionError(
f"zip file for '{data_choice}' dataset is not found. Please download it from '{URL[data_choice]}'."
)

zip_path = zip_path[0]
util.unzip(zip_path=zip_path, dst=path, remove=False)

return data_dir
Expand Down

0 comments on commit 7517563

Please sign in to comment.