Skip to content

Commit

Permalink
fix: create data cache path thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Oct 21, 2024
1 parent 02367dc commit 3345f59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions miv/io/openephys/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def analysis_path(self):

@analysis_path.setter
def analysis_path(self, path):
if not os.path.isdir(path):
os.makedirs(path)
os.makedirs(path, exist_ok=True)
self._analysis_path = path

def save_figure(
Expand Down Expand Up @@ -269,6 +268,8 @@ def load_ttl_event(self):
states, full_words, timestamps, sampling_rate, initial_state = load_ttl_event(
self.data_path
)
if timestamps.size == 0:
self.logger.warning(f"TTL event was loaded but data is empty: {self.data_path}")
return Signal(data=states[:, None], timestamps=timestamps, rate=sampling_rate)

def set_channel_mask(self, channel_id: Iterable[int]):
Expand Down

0 comments on commit 3345f59

Please sign in to comment.