Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pylossless/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ def find_breaks(self):
"""
if "find_breaks" not in self.config or not self.config["find_breaks"]:
return
if not self.raw.annotations:
logger.debug("No annotations found in raw object. Skipping find_breaks.")
return
breaks = annotate_break(self.raw, **self.config["find_breaks"])
self.raw.set_annotations(breaks + self.raw.annotations)

Expand Down
3 changes: 3 additions & 0 deletions pylossless/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def test_find_breaks(logging):
pipeline.find_breaks(message="Looking for break periods between tasks")
else:
pipeline.find_breaks()
# Now explicitly remove annotations and make sure we avoid MNE's error.
pipeline.raw.set_annotations(None)
pipeline.find_breaks()
Path(config_fname).unlink() # delete config file


Expand Down
Loading