MCPcopy
hub / github.com/mne-tools/mne-python / assert_and_remove_boundary_annot

Function assert_and_remove_boundary_annot

mne/utils/_testing.py:170–183  ·  view source on GitHub ↗

Assert that there are boundary annotations and remove them.

(annotations, n=1)

Source from the content-addressed store, hash-verified

168
169
170def assert_and_remove_boundary_annot(annotations, n=1):
171 """Assert that there are boundary annotations and remove them."""
172 __tracebackhide__ = True
173
174 from ..io import BaseRaw
175
176 if isinstance(annotations, BaseRaw): # allow either input
177 annotations = annotations.annotations
178 for key in ("EDGE", "BAD"):
179 idx = np.where(annotations.description == f"{key} boundary")[0]
180 assert len(idx) == n, (
181 f"Got {len(idx)} '{key} boundary' annotations, expected {n}"
182 )
183 annotations.delete(idx)
184
185
186def assert_object_equal(a, b, *, err_msg="Object mismatch", allclose=False):

Callers 5

test_annotation_cropFunction · 0.90
test_basicsFunction · 0.90
test_cropFunction · 0.90
test_crop_moreFunction · 0.90

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected