From 8ba4941171387f2ef29cb3895b09c2c27c737cf6 Mon Sep 17 00:00:00 2001 From: Zain Sohail Date: Thu, 13 Jun 2024 22:51:07 +0200 Subject: [PATCH] fix condition --- sed/dataset/dataset.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sed/dataset/dataset.py b/sed/dataset/dataset.py index 526c5000..41a7f78c 100644 --- a/sed/dataset/dataset.py +++ b/sed/dataset/dataset.py @@ -149,7 +149,6 @@ def data_name(self, value: str): self._datasets = DatasetsManager.load_datasets_dict() self._state = self._check_dataset_availability() self._subdirs = self._state.get("subdirs", []) - self._set_data_dir(None, True) @property def existing_data_paths(self) -> list: @@ -360,8 +359,8 @@ def get( files_in_dir = self._get_file_list(kwargs.get("ignore_zip", True)) file_list: list = self._state.get("files", []) - # if file_list is subset of/same as files_in_dir, then don't download/extract data - if len(file_list) != 0 and set(file_list).issubset(set(files_in_dir)): + # if all files are present, skip download + if all(file in files_in_dir for file in file_list): logger.info(f"{self._data_name} data is already present.") else: url: str = self._state.get("url")