Skip to content

Commit

Permalink
FIX: update more paths
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-huberty committed Aug 28, 2024
1 parent dd997fb commit dfd8616
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/run_eog_lstm_regression_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,29 +167,30 @@ def process(*args, tmax=None):
try:
subject, run = args[0]
raw, raw_clean, raw_noise = clean_data(subject=subject, run=run, tmax=tmax)
raw.export(root + f"{subject}_{run}_original.edf")
raw_clean.export(root + f"{subject}_{run}_clean.edf")
raw_noise.export(root + f"{subject}_{run}_noise.edf")
raw.export(root / f"{subject}_{run}_original.edf")
raw_clean.export(root / f"{subject}_{run}_clean.edf")
raw_noise.export(root / f"{subject}_{run}_noise.edf")
except:
pass


#root = "processed/"
root = ""
root = Path(__file__).parent.parent / "data" / "paper" / "processed"


if __name__ == "__main__":

nb_processes = 5
Path(root).mkdir(exist_ok=True)
if not root.exists():
root.mkdir()

runs_dict = eoglearn.datasets.eegeyenet.get_subjects_runs()
subject_run = np.concatenate([[(subject, run)
for run in runs_dict[subject]]
for subject in runs_dict])
subject_run = [(subject, run)
for subject, run in subject_run
if not Path(root + f"{subject}_{run}_noise.edf").exists()]
if not (root / f"{subject}_{run}_noise.edf").exists()]

p = multiprocessing.Pool(nb_processes)
p.map(process, subject_run)

0 comments on commit dfd8616

Please sign in to comment.