Skip to content

Commit

Permalink
add FileNotFoundError to load_TS
Browse files Browse the repository at this point in the history
  • Loading branch information
mtorabi59 committed Apr 30, 2024
1 parent db699bd commit cfcd20c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pydfc/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,15 @@ def load_TS(
if "{run}" in file_name:
assert run is not None, "run must be provided"
TS_file = TS_file.replace("{run}", run)
time_series = np.load(
f"{data_root}/{subj_fldr}/{TS_file}", allow_pickle="True"
).item()

try:
time_series = np.load(
f"{data_root}/{subj_fldr}/{TS_file}", allow_pickle="True"
).item()
except FileNotFoundError:
print(f"File {TS_file} not found for {subj}")
continue

if TS[session] is None:
TS[session] = time_series
else:
Expand Down

0 comments on commit cfcd20c

Please sign in to comment.