Skip to content

Commit aa74f02

Browse files
larsoneragramfort
authored andcommitted
ENH: Default to empty vertex list (#6139)
1 parent 35d7c53 commit aa74f02

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

mne/label.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ class Label(object):
196196
"""
197197

198198
@verbose
199-
def __init__(self, vertices, pos=None, values=None, hemi=None, comment="",
200-
name=None, filename=None, subject=None, color=None,
201-
verbose=None): # noqa: D102
199+
def __init__(self, vertices=(), pos=None, values=None, hemi=None,
200+
comment="", name=None, filename=None, subject=None,
201+
color=None, verbose=None): # noqa: D102
202202
# check parameters
203203
if not isinstance(hemi, str):
204204
raise ValueError('hemi must be a string, not %s' % type(hemi))

mne/tests/test_label.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ def test_annot_io():
376376
for l1, l in zip(parc1, parc_lh):
377377
assert_labels_equal(l1, l)
378378

379+
# test that the annotation is complete (test Label() support)
380+
rr = read_surface(op.join(surf_dir, 'lh.white'))[0]
381+
label = sum(labels, Label(hemi='lh', subject='fsaverage')).lh
382+
assert_array_equal(label.vertices, np.arange(len(rr)))
383+
379384

380385
@testing.requires_testing_data
381386
def test_morph_labels():

0 commit comments

Comments
 (0)