Skip to content

Commit 967861e

Browse files
committed
FIX: Update for newer PyVista and exec()
1 parent 0fdab68 commit 967861e

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

mne_nirs/io/fold/_fold.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def _generate_montage_locations():
5252
5353
Data is returned in the same format as the eeg_positions library.
5454
"""
55-
# standard_1020 and standard_1005 are in MNI (fsaverage) space already,
55+
# standard_1020 and colin27_1005 are in MNI (fsaverage) space already,
5656
# but we need to undo the scaling that head_scale will do
5757
montage = mne.channels.make_standard_montage(
58-
"standard_1005", head_size=0.09700884729534559
58+
"colin27_1005", head_size=0.09700884729534559
5959
)
6060
for d in montage.dig:
6161
d["coord_frame"] = FIFF.FIFFV_MNE_COORD_MNI_TAL

mne_nirs/io/fold/tests/test_fold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_channel_specificity(monkeypatch, tmp_path, fold_files):
5757
res = fold_channel_specificity(raw, **kwargs)
5858
assert len(res) == 2
5959
assert res[0].shape == (n_want, 14)
60-
montage = make_standard_montage("standard_1005", head_size=0.09700884729534559)
60+
montage = make_standard_montage("colin27_1005", head_size=0.09700884729534559)
6161
fids = read_fiducials(
6262
Path(mne.__file__).parent / "data" / "fsaverage" / "fsaverage-fiducials.fif"
6363
)[0]

mne_nirs/tests/test_examples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,7 @@ def test_examples(fname, requires_pyvista):
7878
test_file_path = examples_path() + fname
7979
with open(test_file_path) as fid:
8080
code = fid.read()
81-
exec(code, locals(), locals())
81+
# Use a single namespace dict (not separate globals/locals) so that names
82+
# defined at module level in the example (e.g. imports) are visible
83+
# inside functions the example itself defines.
84+
exec(code, {"__name__": "__main__"})

mne_nirs/visualisation/_plot_3d_montage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ def plot_3d_montage(
238238
vp.GetOrigin()
239239
)
240240
actor = brain.plotter.add_text(
241-
name,
242-
ch_pos,
241+
text=name,
242+
position=ch_pos,
243243
font_size=font_size,
244244
color=(0.0, 0.0, 0.0),
245245
**add_text_kwargs,

0 commit comments

Comments
 (0)