File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -718,6 +718,9 @@ def find_breaks(self):
718718 """
719719 if "find_breaks" not in self .config or not self .config ["find_breaks" ]:
720720 return
721+ if not self .raw .annotations :
722+ logger .debug ("No annotations found in raw object. Skipping find_breaks." )
723+ return
721724 breaks = annotate_break (self .raw , ** self .config ["find_breaks" ])
722725 self .raw .set_annotations (breaks + self .raw .annotations )
723726
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ def test_find_breaks(logging):
4343 pipeline .find_breaks (message = "Looking for break periods between tasks" )
4444 else :
4545 pipeline .find_breaks ()
46+ # Now explicitly remove annotations and make sure we avoid MNE's error.
47+ pipeline .raw .set_annotations (None )
48+ pipeline .find_breaks ()
4649 Path (config_fname ).unlink () # delete config file
4750
4851
You can’t perform that action at this time.
0 commit comments