Skip to content

Commit f952d58

Browse files
committed
Merge remote-tracking branch 'upstream/main' into kernel
* upstream/main: (37 commits) Use constrained layout in matplotlib visualization (mne-tools#12050) Add raw stc (mne-tools#12001) [MRG] update codeowners (mne-tools#12089) DOC: Morlet wavelet length in tfr_morlet (mne-tools#12073) BUG: Fix bug with mne browser backend (mne-tools#12078) Cache avatars (mne-tools#12077) BUG: Fix bug with ch_name resolution (mne-tools#12086) add unicode roundtrip for FIF (mne-tools#12080) add Ivan to names.inc (mne-tools#12081) MAINT: Work around PySide 6.5.3 event loop error (mne-tools#12076) mne-tools#11608, buggfix and docstring update (mne-tools#12066) MAINT: Fix broken examples (mne-tools#12074) Add UI Event linking to DraggableColorbar (mne-tools#12057) handle lazy loading through .pyi type stubs (mne-tools#12072) BUG: Fix bug with sensor_colors (mne-tools#12068) clean up some deprecations (mne-tools#12067) Allow not dropping bads when creating or plotting Spectrum objs (mne-tools#12006) Collapsible html repr for raw/info (mne-tools#12064) BUG: Fix bug with pickling MNEBadsList (mne-tools#12063) add details for Denis (mne-tools#12065) ...
2 parents 5ffedd8 + fdaeb86 commit f952d58

File tree

262 files changed

+3850
-3997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+3850
-3997
lines changed

.github/CODEOWNERS

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#################################################
2525

2626
# Artifact regression
27-
/mne/preprocessing/_regress.py @wmvanvliet @cbrnr
27+
/mne/preprocessing/_regress.py @wmvanvliet
2828
/mne/preprocessing/tests/test_regress.py @wmvanvliet
2929

3030
# Beamforming
@@ -33,25 +33,26 @@
3333
*lcmv*.py @britta-wstnr
3434

3535
# Channels
36-
/mne/channels @cbrnr @agramfort @mscheltienne
36+
/mne/channels @agramfort @mscheltienne @dengemann @jasmainak
3737

3838
# Core sensor-space classes
39-
/mne/epochs.py @drammock @agramfort @mscheltienne
40-
/mne/evoked.py @drammock @agramfort @mscheltienne
41-
/mne/io/*.* @drammock @cbrnr @agramfort @mscheltienne
39+
/mne/epochs.py @drammock @agramfort @mscheltienne @dengemann
40+
/mne/evoked.py @drammock @agramfort @mscheltienne @dengemann
41+
/mne/io/*.* @drammock @cbrnr @agramfort @mscheltienne @dengemann
4242

4343
# Current-source density
44-
/mne/preprocessing/_csd.py @alexrockhill
44+
/mne/preprocessing/_csd.py @alexrockhill @dengemann
4545

4646
# Decoding
47-
/mne/decoding/csp.py @cbrnr @agramfort
47+
/mne/decoding/csp.py @cbrnr @agramfort @dengemann
48+
/mne/decoding/*.py @jasmainak
4849

4950
# fNIRS
5051
/mne/preprocessing/nirs @rob-luke
5152
*fnirs*.py @rob-luke
5253

5354
# forward
54-
/mne/forward/ @agramfort
55+
/mne/forward/ @agramfort @jasmainak
5556
*forward*.py @agramfort
5657

5758
# Intracranial
@@ -69,19 +70,21 @@
6970
/mne/io/nirx @rob-luke
7071
/mne/io/snirf @rob-luke
7172
/mne/export @sappelhoff @cbrnr
73+
/mne/io/eeglab.py @jasmainak
74+
/mne/io/eeglab/tests/test_eeglab.py @jasmainak
7275

7376
# Minimum Norm
7477
/mne/minimum_norm @agramfort
7578

7679
# Preprocessing
77-
/mne/preprocessing/ica.py @cbrnr @adam2392 @agramfort @mscheltienne
78-
/mne/preprocessing/infomax_.py @cbrnr @adam2392 @mscheltienne
80+
/mne/preprocessing/ica.py @cbrnr @adam2392 @agramfort @mscheltienne @dengemann
81+
/mne/preprocessing/infomax_.py @cbrnr @adam2392 @mscheltienne @dengemann
7982
/mne/preprocessing/*annotate*.py @mscheltienne
8083
/mne/preprocessing/bads.py @mscheltienne
8184
/mne/preprocessing/e*g.py @mscheltienne
8285

8386
# Report
84-
/mne/report @hoechenberger
87+
/mne/report @hoechenberger @dengemann @jasmainak
8588

8689
# Simulation
8790
/mne/simulation/ @agramfort
@@ -93,25 +96,28 @@
9396
/mne/_freesurfer.py @alexrockhill @larsoner
9497

9598
# TFR
96-
/mne/time_frequency @drammock @cbrnr @adam2392 @mscheltienne
99+
/mne/time_frequency @drammock @adam2392 @mscheltienne
97100

98101
# Viz
99-
/mne/viz @drammock @cbrnr
102+
/mne/viz @drammock @dengemann
100103
/mne/viz/_brain @larsoner @wmvanvliet
101104
/mne/viz/ui_events.py @wmvanvliet
102-
/tutorials/visualization @larsoner @wmvanvliet
103-
/examples/visualization @larsoner
105+
/tutorials/visualization @larsoner @wmvanvliet @dengemann
106+
/examples/visualization @larsoner @dengemann
107+
108+
# Datasets
109+
/mne/datasets/brainstorm @jasmainak
104110

105111
#########################
106112
# Project-level / other #
107113
#########################
108114

109115
# Examples and tutorials
110-
/examples @drammock @agramfort
111-
/tutorials @drammock @agramfort
116+
/examples @drammock @agramfort @dengemann
117+
/tutorials @drammock @agramfort @dengemann
112118

113119
# Non-tutorial documentation text and infrastructure
114-
/doc @larsoner @drammock @agramfort
120+
/doc @larsoner @drammock @agramfort @dengemann
115121
/logo @drammock
116122

117123
# Installation documentation
@@ -120,5 +126,5 @@
120126
# Project infrastructure and CIs
121127
/*.* @larsoner @drammock # files in the root directory
122128
/.circleci @larsoner
123-
/.github @larsoner @cbrnr
129+
/.github @larsoner
124130
/tools @larsoner @drammock

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
package:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- uses: actions/setup-python@v4
2323
with:
2424
python-version: '3.10'

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ repos:
77

88
# Ruff mne
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.0.291
10+
rev: v0.0.292
1111
hooks:
1212
- id: ruff
1313
name: ruff mne
1414
files: ^mne/
1515

1616
# Ruff tutorials and examples
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.0.291
18+
rev: v0.0.292
1919
hooks:
2020
- id: ruff
2121
name: ruff tutorials and examples
@@ -26,7 +26,7 @@ repos:
2626

2727
# Codespell
2828
- repo: https://github.com/codespell-project/codespell
29-
rev: v2.2.5
29+
rev: v2.2.6
3030
hooks:
3131
- id: codespell
3232
additional_dependencies:

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ recursive-include tutorials *.py
1515
recursive-include tutorials *.txt
1616

1717
recursive-include mne *.py
18+
recursive-include mne *.pyi
1819
recursive-include mne/data *
1920
recursive-include mne/icons *
2021
recursive-include mne/data/helmets *

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ sample_data:
3333
testing_data:
3434
@python -c "import mne; mne.datasets.testing.data_path(verbose=True);"
3535

36-
pytest: test
37-
3836
test-no-network: in
3937
sudo unshare -n -- sh -c 'MNE_SKIP_NETWORK_TESTS=1 py.test mne'
4038

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The minimum required dependencies to run MNE-Python are:
9696
- Python >= 3.8
9797
- NumPy >= 1.21.2
9898
- SciPy >= 1.7.1
99-
- Matplotlib >= 3.4.3
99+
- Matplotlib >= 3.5.0
100100
- pooch >= 1.5
101101
- tqdm
102102
- Jinja2
File renamed without changes.

doc/_static/js/contrib-avatars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function putAvatarsInPage() {
4747
}
4848
// finish
4949
outer.append(title, inner);
50-
document.getElementById("institution-logos").after(outer);
50+
document.body.append(outer);
5151
}
5252

5353
putAvatarsInPage();

doc/_static/js/set_installer_tab.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/ */
2+
3+
function documentReady(callback) {
4+
if (document.readyState != "loading") callback();
5+
else document.addEventListener("DOMContentLoaded", callback);
6+
}
7+
8+
function setTabs() {
9+
var platform = "linux";
10+
if (navigator.userAgent.indexOf("Win") !== -1) {
11+
platform = "windows";
12+
}
13+
if (navigator.userAgent.indexOf("Mac") !== -1) {
14+
// there's no good way to distinguish intel vs M1 in javascript so we
15+
// just default to showing the first of the 2 macOS tabs
16+
platform = "macos-intel";
17+
}
18+
let all_tab_nodes = document.querySelectorAll(
19+
'.platform-selector-tabset')[0].children;
20+
let input_nodes = [...all_tab_nodes].filter(
21+
child => child.nodeName === "INPUT");
22+
let tab_label_nodes = [...document.querySelectorAll('.sd-tab-label')];
23+
let correct_label = tab_label_nodes.filter(
24+
// label.id is drawn from :name: property in the rST, which must
25+
// be unique across the whole site (*sigh*)
26+
label => label.id.startsWith(platform))[0];
27+
let input_id = correct_label.getAttribute('for');
28+
let correct_input = input_nodes.filter(node => node.id === input_id)[0];
29+
correct_input.checked = true;
30+
}
31+
32+
documentReady(setTabs);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/ */
2+
3+
function documentReady(callback) {
4+
if (document.readyState != "loading") callback();
5+
else document.addEventListener("DOMContentLoaded", callback);
6+
}
7+
8+
async function getRelease() {
9+
result = await fetch("https://api.github.com/repos/mne-tools/mne-installers/releases/latest");
10+
data = await result.json();
11+
return data;
12+
}
13+
async function warnVersion() {
14+
data = await getRelease();
15+
// Take v1.5.1 for example and change to 1.5
16+
ids = ["linux-installers", "macos-intel-installers", "macos-apple-installers", "windows-installers"];
17+
warn = false;
18+
ids.forEach((id) => {
19+
label_id = document.getElementById(id);
20+
// tab is immediately after label
21+
children = [].slice.call(label_id.parentNode.children);
22+
div = children[children.indexOf(label_id) + 1];
23+
a = div.children[0].children[0]; // div->p->a
24+
ending = a.href.split("-").slice(-1)[0]; // Should be one of: ["macOS_Intel.pkg", "macOS_M1.pkg", "Linux.sh", "Windows.exe"]
25+
data["assets"].every((asset) => {
26+
// find the matching asset
27+
if (!asset["browser_download_url"].endsWith(ending)) {
28+
return true; // continue
29+
}
30+
old_stem = a.href.split("/").slice(-1)[0];
31+
new_stem = asset["browser_download_url"].split("/").slice(-1)[0];
32+
a.href = asset["browser_download_url"];
33+
// also replace the command on Linux
34+
if (ending === "Linux.sh") {
35+
code = document.getElementById("codecell0");
36+
}
37+
if (!warn) {
38+
// MNE-Python-1.5.1_0-Linux.sh to 1.5 for example
39+
old_ver = old_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join(".");
40+
new_ver = new_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join(".");
41+
if (old_ver !== new_ver) {
42+
warn = `The installers below are for version ${new_ver} as ${old_ver} is no longer supported`;
43+
}
44+
}
45+
return false; // do not continue
46+
});
47+
});
48+
if (warn) {
49+
let outer = document.createElement("div");
50+
let title = document.createElement("p");
51+
let inner = document.createElement("p");
52+
outer.setAttribute("class", "admonition warning");
53+
title.setAttribute("class", "admonition-title");
54+
title.innerText = "Warning";
55+
inner.innerText = warn;
56+
outer.append(title, inner);
57+
document.querySelectorAll('.platform-selector-tabset')[0].before(outer);
58+
}
59+
}
60+
61+
documentReady(warnVersion);

doc/_templates/homepage.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@
4141
</div>
4242
{% endfor %}
4343
</div>
44+
<!-- contributors -->
45+
{% include 'avatars.html' %}
4446
</div>

doc/_templates/layout.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@
1717
{%- block scripts_end %}
1818
{{ super() }}
1919
<script src="https://mne.tools/versionwarning.js"></script>
20-
{% if pagename == 'index' %}
21-
<script src="{{ pathto('_static/js/contrib-avatars.js', 1) }}"></script>
22-
{% endif %}
2320
{%- endblock %}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

doc/changes/devel.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,30 @@ Version 1.6.dev0 (development)
2323

2424
Enhancements
2525
~~~~~~~~~~~~
26-
- Improve tests for saving splits with `Epochs` (:gh:`11884` by `Dmitrii Altukhov`_)
26+
- Improve tests for saving splits with :class:`mne.Epochs` (:gh:`11884` by `Dmitrii Altukhov`_)
2727
- Added functionality for linking interactive figures together, such that changing one figure will affect another, see :ref:`tut-ui-events` and :mod:`mne.viz.ui_events`. Current figures implementing UI events are :func:`mne.viz.plot_topomap` and :func:`mne.viz.plot_source_estimates` (:gh:`11685` :gh:`11891` by `Marijn van Vliet`_)
2828
- HTML anchors for :class:`mne.Report` now reflect the ``section-title`` of the report items rather than using a global incrementor ``global-N`` (:gh:`11890` by `Eric Larson`_)
2929
- Added public :func:`mne.io.write_info` to complement :func:`mne.io.read_info` (:gh:`11918` by `Eric Larson`_)
3030
- Added option ``remove_dc`` to to :meth:`Raw.compute_psd() <mne.io.Raw.compute_psd>`, :meth:`Epochs.compute_psd() <mne.Epochs.compute_psd>`, and :meth:`Evoked.compute_psd() <mne.Evoked.compute_psd>`, to allow skipping DC removal when computing Welch or multitaper spectra (:gh:`11769` by `Nikolai Chapochnikov`_)
3131
- Add the possibility to provide a float between 0 and 1 as ``n_grad``, ``n_mag`` and ``n_eeg`` in `~mne.compute_proj_raw`, `~mne.compute_proj_epochs` and `~mne.compute_proj_evoked` to select the number of vectors based on the cumulative explained variance (:gh:`11919` by `Mathieu Scheltienne`_)
32+
- Add extracting all time courses in a label using :func:`mne.extract_label_time_course` without applying an aggregation function (like ``mean``) (:gh:`12001` by `Hamza Abdelhedi`_)
3233
- Added support for Artinis fNIRS data files to :func:`mne.io.read_raw_snirf` (:gh:`11926` by `Robert Luke`_)
3334
- Add helpful error messages when using methods on empty :class:`mne.Epochs`-objects (:gh:`11306` by `Martin Schulz`_)
35+
- Add support for passing a :class:`python:dict` as ``sensor_color`` to specify per-channel-type colors in :func:`mne.viz.plot_alignment` (:gh:`12067` by `Eric Larson`_)
3436
- Add inferring EEGLAB files' montage unit automatically based on estimated head radius using :func:`read_raw_eeglab(..., montage_units="auto") <mne.io.read_raw_eeglab>` (:gh:`11925` by `Jack Zhang`_, :gh:`11951` by `Eric Larson`_)
3537
- Add :class:`~mne.time_frequency.EpochsSpectrumArray` and :class:`~mne.time_frequency.SpectrumArray` to support creating power spectra from :class:`NumPy array <numpy.ndarray>` data (:gh:`11803` by `Alex Rockhill`_)
38+
- Add support for writing forward solutions to HDF5 and convenience function :meth:`mne.Forward.save` (:gh:`12036` by `Eric Larson`_)
3639
- Refactored internals of :func:`mne.read_annotations` (:gh:`11964` by `Paul Roujansky`_)
40+
- By default MNE-Python creates matplotlib figures with ``layout='constrained'`` rather than the default ``layout='tight'`` (:gh:`12050` by `Mathieu Scheltienne`_ and `Eric Larson`_)
3741
- Enhance :func:`~mne.viz.plot_evoked_field` with a GUI that has controls for time, colormap, and contour lines (:gh:`11942` by `Marijn van Vliet`_)
42+
- Add :class:`mne.viz.ui_events.UIEvent` linking for interactive colorbars, allowing users to link figures and change the colormap and limits interactively. This supports :func:`~mne.viz.plot_evoked_topomap`, :func:`~mne.viz.plot_ica_components`, :func:`~mne.viz.plot_tfr_topomap`, :func:`~mne.viz.plot_projs_topomap`, :meth:`~mne.Evoked.plot_image`, and :meth:`~mne.Epochs.plot_image` (:gh:`12057` by `Santeri Ruuskanen`_)
3843

3944
Bugs
4045
~~~~
4146
- Fix bugs with :func:`mne.preprocessing.realign_raw` where the start of ``other`` was incorrectly cropped; and onsets and durations in ``other.annotations`` were left unsynced with the resampled data (:gh:`11950` by :newcontrib:`Qian Chu`)
4247
- Fix bug where ``encoding`` argument was ignored when reading annotations from an EDF file (:gh:`11958` by :newcontrib:`Andrew Gilbert`)
48+
- Mark tests ``test_adjacency_matches_ft`` and ``test_fetch_uncompressed_file`` as network tests (:gh:`12041` by :newcontrib:`Maksym Balatsko`)
49+
- Fix bug with :func:`mne.channels.read_ch_adjacency` (:gh:`11608` by :newcontrib:`Ivan Zubarev`)
4350
- Fix bugs with saving splits for :class:`~mne.Epochs` (:gh:`11876` by `Dmitrii Altukhov`_)
4451
- Fix bug with multi-plot 3D rendering where only one plot was updated (:gh:`11896` by `Eric Larson`_)
4552
- Fix bug where subject birthdays were not correctly read by :func:`mne.io.read_raw_snirf` (:gh:`11912` by `Eric Larson`_)
@@ -53,10 +60,16 @@ Bugs
5360
- Fix bug with :meth:`~mne.viz.Brain.add_annotation` when reading an annotation from a file with both hemispheres shown (:gh:`11946` by `Marijn van Vliet`_)
5461
- Fix bug with axis clip box boundaries in :func:`mne.viz.plot_evoked_topo` and related functions (:gh:`11999` by `Eric Larson`_)
5562
- Fix bug with ``subject_info`` when loading data from and exporting to EDF file (:gh:`11952` by `Paul Roujansky`_)
56-
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` :gh:`12017` by `Paul Roujansky`_)
63+
- Fix bug with delayed checking of :class:`info["bads"] <mne.Info>` (:gh:`12038` by `Eric Larson`_)
64+
- Fix bug with :func:`mne.viz.plot_alignment` where ``sensor_colors`` were not handled properly on a per-channel-type basis (:gh:`12067` by `Eric Larson`_)
65+
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` :gh:`12017` :gh:`12044` by `Paul Roujansky`_)
5766
- Add missing ``overwrite`` and ``verbose`` parameters to :meth:`Transform.save() <mne.transforms.Transform.save>` (:gh:`12004` by `Marijn van Vliet`_)
67+
- Fix parsing of eye-link :class:`~mne.Annotations` when ``apply_offsets=False`` is provided to :func:`~mne.io.read_raw_eyelink` (:gh:`12003` by `Mathieu Scheltienne`_)
5868
- Correctly prune channel-specific :class:`~mne.Annotations` when creating :class:`~mne.Epochs` without the channel(s) included in the channel specific annotations (:gh:`12010` by `Mathieu Scheltienne`_)
69+
- Fix :func:`~mne.viz.plot_volume_source_estimates` with :class:`~mne.VolSourceEstimate` which include a list of vertices (:gh:`12025` by `Mathieu Scheltienne`_)
70+
- Add support for non-ASCII characters in Annotations, Evoked comments, etc when saving to FIFF format (:gh:`12080` by `Daniel McCloy`_)
5971
- Correctly handle passing ``"eyegaze"`` or ``"pupil"`` to :meth:`mne.io.Raw.pick` (:gh:`12019` by `Scott Huberty`_)
72+
- Fix bug with :func:`~mne.viz.plot_raw` where changing ``MNE_BROWSER_BACKEND`` via :func:`~mne.set_config` would have no effect within a Python session (:gh:`12078` by `Santeri Ruuskanen`_)
6073

6174
API changes
6275
~~~~~~~~~~~

doc/changes/names.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@
184184
185185
.. _George O'Neill: https://georgeoneill.github.io
186186

187+
.. _Gonzalo Reina: https://greina.me/
188+
187189
.. _Guillaume Dumas: https://mila.quebec/en/person/guillaume-dumas
188190

189191
.. _Guillaume Favelier: https://github.com/GuillaumeFavelier
@@ -210,6 +212,8 @@
210212

211213
.. _Ilias Machairas: https://github.com/JungleHippo
212214

215+
.. _Ivan Zubarev: https://github.com/zubara
216+
213217
.. _Ivana Kojcic: https://github.com/ikojcic
214218

215219
.. _Jaakko Leppakangas: https://github.com/jaeilepp
@@ -320,6 +324,8 @@
320324

321325
.. _Mainak Jas: https://jasmainak.github.io
322326

327+
.. _Maksym Balatsko: https://github.com/mbalatsko
328+
323329
.. _Marcin Koculak: https://github.com/mkoculak
324330

325331
.. _Marian Dovgialo: https://github.com/mdovgialo

0 commit comments

Comments
 (0)