Skip to content

Commit 41c3d1c

Browse files
Merge pull request #309 from JohnGriffiths/fix_egtmseeg_fetchers
Update fetchers.py
2 parents ac616ba + 3a705e2 commit 41c3d1c

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ jobs:
8080
run: |
8181
python - <<'PY'
8282
import whobpyt
83-
from whobpyt.datasets.fetchers import fetch_egmomi2023, fetch_egmomi2025,fetch_egtmseeg, fetch_egismail2025
83+
from whobpyt.datasets.fetchers import fetch_egmomi2023, fetch_egmomi2025, fetch_egtmseeg, fetch_egismail2025
8484
fetch_egmomi2023()
8585
fetch_egmomi2025()
86+
fetch_egtmseeg()
8687
fetch_egismail2025()
8788
PY
8889

examples/eg__tmseeg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from whobpyt.models.jansen_rit import JansenRitModel,JansenRitParams
2626
from whobpyt.run import ModelFitting
2727
from whobpyt.optimization.custom_cost_JR import CostsJR
28-
from whobpyt.datasets.fetchers import fetch_momi2023
28+
from whobpyt.datasets.fetchers import fetch_egtmseeg
2929

3030
# Python Packages used for processing and displaying given analytical data (supported for .mat and Google Drive files)
3131
import numpy as np
@@ -43,7 +43,7 @@
4343

4444
# %%
4545
# Download and load example data
46-
data_dir = fetch_momi2023()
46+
data_dir = fetch_egtmseeg()
4747

4848
# %%
4949
# Load EEG data

whobpyt/datasets/fetchers.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,12 @@ def fetch_egtmseeg(dest_folder=None, redownload=False):
173173

174174
# If the folder does not exist, create it and download the files
175175
if not os.path.isdir(dest_folder):
176-
177-
os.makedirs(dest_folder)
178-
176+
os.makedirs(dest_folder)
179177
os.chdir(dest_folder)
180-
181-
dlcode = osf_folder_url
182-
pull_file(dlcode, file_name, download_method='wget')
183-
184-
os.chdir(cwd)
178+
for file_code, file_name in files_dict.items():
179+
dlcode = osf_url_pfx + '/' + file_code
180+
pull_file(dlcode, file_name, download_method='wget')
181+
os.chdir(cwd) # go back to where we started
185182

186183
return dest_folder
187184

0 commit comments

Comments
 (0)