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

Function assert_labels_equal

mne/tests/test_label.py:172–187  ·  view source on GitHub ↗

Assert two labels are equal.

(l0, l1, decimal=5, comment=True, color=True)

Source from the content-addressed store, hash-verified

170
171
172def assert_labels_equal(l0, l1, decimal=5, comment=True, color=True):
173 """Assert two labels are equal."""
174 if comment:
175 assert_equal(l0.comment, l1.comment)
176 if color:
177 assert_equal(l0.color, l1.color)
178
179 for attr in ["hemi", "subject"]:
180 attr0 = getattr(l0, attr)
181 attr1 = getattr(l1, attr)
182 msg = f"label.{attr}: {repr(attr0)} != {repr(attr1)}"
183 assert_equal(attr0, attr1, msg)
184 for attr in ["vertices", "pos", "values"]:
185 a0 = getattr(l0, attr)
186 a1 = getattr(l1, attr)
187 assert_array_almost_equal(a0, a1, decimal)
188
189
190def test_copy():

Callers 6

test_label_additionFunction · 0.85
test_label_ioFunction · 0.85
test_annot_ioFunction · 0.85
test_split_labelFunction · 0.85
test_stc_to_labelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected