Skip to content

Commit

Permalink
fix: the bug that multiple links in a dataset cannot be all downloaded;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Nov 9, 2023
1 parent 9beff75 commit 11e6359
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tsdb/utils/downloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _download_and_extract(url: str, saving_path: str) -> Optional[str]:
return saving_path


def download_and_extract(dataset_name: str, dataset_saving_path: str) -> Optional[str]:
def download_and_extract(dataset_name: str, dataset_saving_path: str) -> None:
"""Wrapper of _download_and_extract.
Parameters
Expand All @@ -96,15 +96,11 @@ def download_and_extract(dataset_name: str, dataset_saving_path: str) -> Optiona
dataset_saving_path : str,
The local path for dataset saving.
Returns
-------
saving_path if successful else None
"""
logger.info("Start downloading...")
os.makedirs(dataset_saving_path)
if isinstance(DATABASE[dataset_name], list):
for link in DATABASE[dataset_name]:
return _download_and_extract(link, dataset_saving_path)
_download_and_extract(link, dataset_saving_path)
else:
return _download_and_extract(DATABASE[dataset_name], dataset_saving_path)
_download_and_extract(DATABASE[dataset_name], dataset_saving_path)

0 comments on commit 11e6359

Please sign in to comment.