diff --git a/mne_nirs/io/fold/_fold.py b/mne_nirs/io/fold/_fold.py index ece3a646f..9091e7558 100644 --- a/mne_nirs/io/fold/_fold.py +++ b/mne_nirs/io/fold/_fold.py @@ -52,7 +52,7 @@ def _generate_montage_locations(): Data is returned in the same format as the eeg_positions library. """ - # standard_1020 and standard_1005 are in MNI (fsaverage) space already, + # standard_1020 and colin27_1005 are in MNI (fsaverage) space already, # but we need to undo the scaling that head_scale will do name = "colin27" if check_version("mne", "1.13") else "standard" montage = mne.channels.make_standard_montage( diff --git a/mne_nirs/io/fold/tests/test_fold.py b/mne_nirs/io/fold/tests/test_fold.py index 8ebed78d0..0d7a6b899 100644 --- a/mne_nirs/io/fold/tests/test_fold.py +++ b/mne_nirs/io/fold/tests/test_fold.py @@ -13,6 +13,7 @@ from mne.channels.montage import transform_to_head from mne.datasets.testing import data_path, requires_testing_data from mne.io import read_fiducials, read_raw_nirx +from mne.utils import check_version from numpy.testing import assert_allclose from mne_nirs.io import fold_landmark_specificity @@ -57,7 +58,8 @@ def test_channel_specificity(monkeypatch, tmp_path, fold_files): res = fold_channel_specificity(raw, **kwargs) assert len(res) == 2 assert res[0].shape == (n_want, 14) - montage = make_standard_montage("standard_1005", head_size=0.09700884729534559) + name = "colin27" if check_version("mne", "1.13") else "standard" + montage = make_standard_montage(f"{name}_1005", head_size=0.09700884729534559) fids = read_fiducials( Path(mne.__file__).parent / "data" / "fsaverage" / "fsaverage-fiducials.fif" )[0] diff --git a/mne_nirs/tests/test_examples.py b/mne_nirs/tests/test_examples.py index 0c566ecc3..4b907fe61 100644 --- a/mne_nirs/tests/test_examples.py +++ b/mne_nirs/tests/test_examples.py @@ -57,4 +57,7 @@ def test_examples(fname, requires_pyvista): test_file_path = examples_path() + fname with open(test_file_path) as fid: code = fid.read() - exec(code, locals(), locals()) + # Use a single namespace dict (not separate globals/locals) so that names + # defined at module level in the example (e.g. imports) are visible + # inside functions the example itself defines. + exec(code, {"__name__": "__main__"}) diff --git a/mne_nirs/visualisation/_plot_3d_montage.py b/mne_nirs/visualisation/_plot_3d_montage.py index 0b8d76cff..a02758b9e 100644 --- a/mne_nirs/visualisation/_plot_3d_montage.py +++ b/mne_nirs/visualisation/_plot_3d_montage.py @@ -238,8 +238,8 @@ def plot_3d_montage( vp.GetOrigin() ) actor = brain.plotter.add_text( - name, - ch_pos, + text=name, + position=ch_pos, font_size=font_size, color=(0.0, 0.0, 0.0), **add_text_kwargs,