forked from physionetchallenges/python-example-2026
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRemoveTestCache.py
More file actions
20 lines (16 loc) · 923 Bytes
/
Copy pathRemoveTestCache.py
File metadata and controls
20 lines (16 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import pandas as pd
demotest = pd.read_csv("data/test_set/demographics.csv")
cache_path = ".feature_cache"
for i in demotest.index:
h = demotest.loc[i, "SiteID"]
f = demotest.loc[i, "BidsFolder"]
session = demotest.loc[i, "SessionID"]
if os.path.exists(os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv")):
print(f"Removing {os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv")}")
os.remove(os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv"))
if os.path.exists(os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav")):
print(f"Removing {os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav")}")
os.remove(os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav"))
os.remove(os.path.join(cache_path, "exports", "test_features_raw.csv"))
os.remove(os.path.join(cache_path, "exports", "test_features_preprocessed.csv"))