File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1212import os
1313import json
1414from pathlib import Path
15+ from warnings import warn
1516
1617import numpy as np
1718
@@ -570,6 +571,15 @@ def explore_folder(dirname, experiment_names=None):
570571 stream_name = node_name + "#" + oe_stream_name
571572 else :
572573 stream_name = oe_stream_name
574+
575+ # skip streams if folder is on oebin, but doesn't exist
576+ if not (recording_folder / "continuous" / info ["folder_name" ]).is_dir ():
577+ warn (
578+ f"For { recording_folder } the folder continuous/{ info ['folder_name' ]} is missing. "
579+ f"Skipping { stream_name } continuous stream."
580+ )
581+ continue
582+
573583 raw_filename = recording_folder / "continuous" / info ["folder_name" ] / "continuous.dat"
574584
575585 # Updates for OpenEphys v0.6:
@@ -604,6 +614,14 @@ def explore_folder(dirname, experiment_names=None):
604614 else :
605615 stream_name = oe_stream_name
606616
617+ # skip streams if folder is on oebin, but doesn't exist
618+ if not (recording_folder / "events" / info ["folder_name" ]).is_dir ():
619+ warn (
620+ f"For { recording_folder } the folder events/{ info ['folder_name' ]} is missing. "
621+ f"Skipping { stream_name } event stream."
622+ )
623+ continue
624+
607625 event_stream = info .copy ()
608626 for name in _possible_event_stream_names :
609627 npy_filename = root / "events" / info ["folder_name" ] / f"{ name } .npy"
You can’t perform that action at this time.
0 commit comments