Skip to content

Commit 430bafb

Browse files
committed
fix: throw exception for unhandled case
1 parent 1398794 commit 430bafb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

eegnb/datasets/datasets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,9 @@ def fetch_dataset(
9191
destination = os.path.join(data_dir, "downloaded_data.zip")
9292

9393
if download_method == "gdown":
94-
9594
URL = "https://drive.google.com/uc?id=" + gdrive_locs[experiment]
9695
gdown.download(URL, destination, quiet=False)
97-
9896
elif download_method == "requests":
99-
10097
URL = "https://docs.google.com/uc?export=download"
10198

10299
session = requests.Session()
@@ -120,6 +117,8 @@ def fetch_dataset(
120117
for chunk in response.iter_content(CHUNK_SIZE):
121118
if chunk:
122119
f.write(chunk)
120+
else:
121+
raise ValueError("download_method not supported")
123122

124123
# unzip the file
125124
with zipfile.ZipFile(destination, "r") as zip_ref:

0 commit comments

Comments
 (0)