Skip to content

Commit e2b9af4

Browse files
authored
Merge branch 'main' into enh-13289-peaks-dict
2 parents c90f4fd + 29435fb commit e2b9af4

File tree

12 files changed

+290
-9
lines changed

12 files changed

+290
-9
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
python: '3.13'
7272
kind: pip
7373
- os: ubuntu-latest
74-
python: '3.13'
74+
python: '3.14'
7575
kind: pip-pre
7676
- os: ubuntu-latest
7777
python: '3.13'

doc/changes/dev/13520.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Preserve ``kit_system_id`` in forward-solution ``Info``, by :newcontrib: 'Melih Yayli'

doc/changes/dev/13579.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with montage test error message checking, by `Eric Larson`_.

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
.. _Matti Hämäläinen: https://research.aalto.fi/en/persons/matti-h%C3%A4m%C3%A4l%C3%A4inen/
211211
.. _Matti Toivonen: https://github.com/mattitoi
212212
.. _Mauricio Cespedes Tenorio: https://github.com/mcespedes99
213+
.. _Melih Yayli: https://github.com/yaylim
213214
.. _Michael Straube: https://github.com/mistraube
214215
.. _Michal Žák: https://github.com/michalrzak
215216
.. _Michiru Kaneda: https://github.com/rcmdnk

doc/sphinxext/mne_doc_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def reset_warnings(gallery_conf, fname):
8080
for message in (
8181
# Matplotlib
8282
".*is non-interactive, and thus cannot.*",
83+
# nilearn
84+
r"You are using the.*matplotlib backend that[.\n]*",
8385
# pybtex
8486
".*pkg_resources is deprecated as an API.*",
8587
):

examples/inverse/mixed_source_space_inverse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
Compute MNE inverse solution on evoked data with a mixed source space
66
=====================================================================
77
8-
Create a mixed source space and compute an MNE inverse solution on an
9-
evoked dataset.
8+
Create a mixed source space and compute an MNE inverse solution on an evoked dataset.
109
"""
1110
# Author: Annalisa Pascarella <[email protected]>
1211
#

mne/channels/tests/test_standard_montage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def test_set_montage_artinis_basic():
292292
)
293293
new = RawArray(np.random.normal(size=(2, len(raw))), info_new)
294294
raw.add_channels([new], force_update_info=True)
295-
with pytest.raises(ValueError, match="is not in list"):
295+
with pytest.raises(ValueError, match="not in list"):
296296
raw.set_montage("artinis-brite23")
297297

298298
# Detector not in montage: fail
@@ -302,5 +302,5 @@ def test_set_montage_artinis_basic():
302302
)
303303
new = RawArray(np.random.normal(size=(2, len(raw))), info_new)
304304
raw.add_channels([new], force_update_info=True)
305-
with pytest.raises(ValueError, match="is not in list"):
305+
with pytest.raises(ValueError, match="not in list"):
306306
raw.set_montage("artinis-brite23")

mne/forward/_make_forward.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _prepare_for_forward(
496496
mri_id = dict(machid=np.zeros(2, np.int32), version=0, secs=0, usecs=0)
497497

498498
info_trans = str(trans) if isinstance(trans, Path) else trans
499-
info = Info(
499+
kwargs_fwd_info = dict(
500500
chs=info["chs"],
501501
comps=info["comps"],
502502
# The forward-writing code always wants a dev_head_t, so give an identity one
@@ -510,6 +510,11 @@ def _prepare_for_forward(
510510
bads=info["bads"],
511511
mri_head_t=mri_head_t,
512512
)
513+
514+
if "kit_system_id" in info:
515+
kwargs_fwd_info["kit_system_id"] = info["kit_system_id"]
516+
517+
info = Info(**kwargs_fwd_info)
513518
info._update_redundant()
514519
info._check_consistency()
515520
logger.info("")

mne/forward/tests/test_make_forward.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ def test_make_forward_solution_kit(tmp_path, fname_src_small):
270270
)
271271
_compare_forwards(fwd, fwd_py, 157, n_src_small, meg_rtol=1e-3, meg_atol=1e-7)
272272

273+
# NEW TEST: ensure kit_system_id survives the forward-info rewrite
274+
assert "kit_system_id" in fwd_py["info"]
275+
273276

274277
@requires_mne
275278
def test_make_forward_solution_bti(fname_src_small):

mne/report/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3546,7 +3546,7 @@ def _add_projs(
35463546
evoked = None
35473547
if isinstance(info, Info): # no-op
35483548
pass
3549-
elif hasattr(info, "info"): # try to get the file name
3549+
elif isinstance(getattr(info, "info", None), Info): # try to get the file name
35503550
if isinstance(info, Evoked):
35513551
evoked = info
35523552
info = info.info

0 commit comments

Comments
 (0)