Skip to content

Commit 45c6a0b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add_tfr_weights
2 parents 9fe1fb6 + 56e522b commit 45c6a0b

File tree

164 files changed

+4005
-1435
lines changed

Some content is hidden

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

164 files changed

+4005
-1435
lines changed

Diff for: .github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
sed -i '/dipy/d' environment.yml
100100
sed -i 's/- mne$/- mne-base/' environment.yml
101101
if: matrix.os == 'ubuntu-latest' && startswith(matrix.kind, 'conda') && matrix.python == '3.12'
102-
- uses: mamba-org/setup-micromamba@v1
102+
- uses: mamba-org/setup-micromamba@v2
103103
with:
104104
environment-file: ${{ env.CONDA_ENV }}
105105
environment-name: mne

Diff for: .pre-commit-config.yaml

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# Ruff mne
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.6.5
4+
rev: v0.6.9
55
hooks:
66
- id: ruff
77
name: ruff lint mne
@@ -51,12 +51,33 @@ repos:
5151

5252
# sorting
5353
- repo: https://github.com/pre-commit/pre-commit-hooks
54-
rev: v4.6.0
54+
rev: v5.0.0
5555
hooks:
5656
- id: file-contents-sorter
5757
files: ^doc/changes/names.inc|^.mailmap
5858
args: ["--ignore-case"]
5959

60+
- repo: https://github.com/pappasam/toml-sort
61+
rev: v0.23.1
62+
hooks:
63+
- id: toml-sort-fix
64+
files: pyproject.toml
65+
66+
# dependencies
67+
- repo: local
68+
hooks:
69+
- id: dependency-sync
70+
name: Sync dependency list between pyproject.toml and README.rst
71+
language: python
72+
entry: ./tools/hooks/sync_dependencies.py
73+
files: pyproject.toml
74+
additional_dependencies: ["mne"]
75+
76+
77+
# these should *not* be run on CIs:
78+
ci:
79+
skip: [dependency-sync] # needs MNE to work, which exceeds the free tier space alloc.
80+
6081
# The following are too slow to run on local commits, so let's only run on CIs:
6182
#
6283
# - repo: https://github.com/pre-commit/mirrors-mypy

Diff for: README.rst

+7-32
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ only, use pip_ in a terminal:
4343
4444
$ pip install --upgrade mne
4545
46-
The current MNE-Python release requires Python 3.9 or higher. MNE-Python 0.17
47-
was the last release to support Python 2.7.
48-
4946
For more complete instructions, including our standalone installers and more
5047
advanced installation methods, please refer to the `installation guide`_.
5148

@@ -73,42 +70,20 @@ Dependencies
7370

7471
The minimum required dependencies to run MNE-Python are:
7572

73+
.. ↓↓↓ BEGIN CORE DEPS LIST. DO NOT EDIT! HANDLED BY PRE-COMMIT HOOK ↓↓↓
74+
7675
- `Python <https://www.python.org>`__ ≥ 3.9
77-
- `NumPy <https://numpy.org>`__ ≥ 1.24
78-
- `SciPy <https://scipy.org>`__ ≥ 1.10
76+
- `NumPy <https://numpy.org>`__ ≥ 1.23
77+
- `SciPy <https://scipy.org>`__ ≥ 1.9
7978
- `Matplotlib <https://matplotlib.org>`__ ≥ 3.6
8079
- `Pooch <https://www.fatiando.org/pooch/latest/>`__ ≥ 1.5
8180
- `tqdm <https://tqdm.github.io>`__
8281
- `Jinja2 <https://palletsprojects.com/p/jinja/>`__
8382
- `decorator <https://github.com/micheles/decorator>`__
84-
- `lazy_loader <https://pypi.org/project/lazy_loader/>`__
85-
86-
For full functionality, some functions require:
87-
88-
- `scikit-learn <https://scikit-learn.org/stable/>`__ ≥ 1.2
89-
- `Joblib <https://joblib.readthedocs.io/en/latest/index.html>`__ ≥ 1.2 (for parallelization)
90-
- `mne-qt-browser <https://github.com/mne-tools/mne-qt-browser>`__ ≥ 0.5 (for fast raw data visualization)
91-
- `Qt <https://www.qt.io>`__ ≥ 5.15 via one of the following bindings (for fast raw data visualization and interactive 3D visualization):
92-
93-
- `PySide6 <https://doc.qt.io/qtforpython-6/>`__ ≥ 6.0
94-
- `PyQt6 <https://www.riverbankcomputing.com/software/pyqt/>`__ ≥ 6.0
95-
- `PyQt5 <https://www.riverbankcomputing.com/software/pyqt/>`__ ≥ 5.15
96-
97-
- `Numba <https://numba.pydata.org>`__ ≥ 0.56.4
98-
- `NiBabel <https://nipy.org/nibabel/>`__ ≥ 3.2.1
99-
- `OpenMEEG <https://openmeeg.github.io>`__ ≥ 2.5.6
100-
- `pandas <https://pandas.pydata.org>`__ ≥ 1.5.2
101-
- `Picard <https://pierreablin.github.io/picard/>`__ ≥ 0.3
102-
- `CuPy <https://cupy.dev>`__ ≥ 9.0.0 (for NVIDIA CUDA acceleration)
103-
- `DIPY <https://dipy.org>`__ ≥ 1.4.0
104-
- `imageio <https://imageio.readthedocs.io/en/stable/>`__ ≥ 2.8.0
105-
- `PyVista <https://pyvista.org>`__ ≥ 0.37 (for 3D visualization)
106-
- `PyVistaQt <https://qtdocs.pyvista.org>`__ ≥ 0.9 (for 3D visualization)
107-
- `mffpy <https://github.com/BEL-Public/mffpy>`__ ≥ 0.5.7
108-
- `h5py <https://www.h5py.org>`__
109-
- `h5io <https://github.com/h5io/h5io>`__
110-
- `pymatreader <https://pymatreader.readthedocs.io/en/latest/>`__
83+
- `lazy-loader <https://pypi.org/project/lazy_loader>`__ ≥ 0.3
84+
- `packaging <https://packaging.pypa.io/en/stable/>`__
11185

86+
.. ↑↑↑ END CORE DEPS LIST. DO NOT EDIT! HANDLED BY PRE-COMMIT HOOK ↑↑↑
11287
11388
Contributing
11489
^^^^^^^^^^^^

Diff for: azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ stages:
111111
- bash: |
112112
set -e
113113
python -m pip install --progress-bar off --upgrade pip
114-
python -m pip install --progress-bar off "mne-qt-browser[opengl] @ git+https://github.com/mne-tools/mne-qt-browser.git@main" pyvista scikit-learn pytest-error-for-skips python-picard qtpy nibabel sphinx-gallery PySide6
114+
python -m pip install --progress-bar off "mne-qt-browser[opengl] @ git+https://github.com/mne-tools/mne-qt-browser.git@main" pyvista scikit-learn pytest-error-for-skips python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1"
115115
python -m pip uninstall -yq mne
116116
python -m pip install --progress-bar off --upgrade -e .[test]
117117
displayName: 'Install dependencies with pip'
@@ -201,7 +201,7 @@ stages:
201201
displayName: 'PyQt6'
202202
- bash: |
203203
set -eo pipefail
204-
python -m pip install PySide6
204+
python -m pip install "PySide6!=6.8.0,!=6.8.0.1"
205205
mne sys_info -pd
206206
mne sys_info -pd | grep "qtpy .* (PySide6=.*)$"
207207
PYTEST_QT_API=PySide6 pytest ${TEST_OPTIONS}

Diff for: doc/_static/style.css

+63-17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313

1414

1515
html[data-theme="light"] {
16+
/* pydata-sphinx-theme overrides */
17+
/* ↓↓↓ use default "info" colors for "primary" */
18+
--pst-color-primary: #276be9;
19+
--pst-color-primary-bg: #dce7fc;
20+
/* ↓↓↓ use default "primary" colors for "info" */
21+
--pst-color-info: var(--pst-teal-500);
22+
--pst-color-info-bg: var(--pst-teal-200);
23+
/* ↓↓↓ use "warning" colors for "secondary" */
24+
--pst-color-secondary: var(--pst-color-warning);
25+
--pst-color-secondary-bg: var(--pst-color-warning-bg);
26+
/* ↓↓↓ make sure new primary (link) color propogates to links on code */
27+
--pst-color-inline-code-links: var(--pst-color-link);
28+
/* ↓↓↓ make sure new secondary (hover) color propogates to hovering on table rows */
29+
--pst-color-table-row-hover-bg: var(--pst-color-secondary-bg);
1630
/* topbar logo links */
1731
--mne-color-github: #000;
1832
--mne-color-discourse: #d0232b;
@@ -21,8 +35,6 @@ html[data-theme="light"] {
2135
--copybtn-opacity: 0.75;
2236
/* card header bg color */
2337
--mne-color-card-header: rgba(0, 0, 0, 0.05);
24-
/* section headings */
25-
--mne-color-heading: #003e80;
2638
/* sphinx-gallery overrides */
2739
--sg-download-a-background-color: var(--pst-color-primary);
2840
--sg-download-a-background-image: unset;
@@ -33,6 +45,20 @@ html[data-theme="light"] {
3345
--sg-download-a-hover-box-shadow-2: none;
3446
}
3547
html[data-theme="dark"] {
48+
/* pydata-sphinx-theme overrides */
49+
/* ↓↓↓ use default "info" colors for "primary" */
50+
--pst-color-primary: #79a3f2;
51+
--pst-color-primary-bg: #06245d;
52+
/* ↓↓↓ use default "primary" colors for "info" */
53+
--pst-color-info: var(--pst-teal-400);
54+
--pst-color-info-bg: var(--pst-teal-800);
55+
/* ↓↓↓ use "warning" colors for "secondary" */
56+
--pst-color-secondary: var(--pst-color-warning);
57+
--pst-color-secondary-bg: var(--pst-color-warning-bg);
58+
/* ↓↓↓ make sure new primary (link) color propogates to links on code */
59+
--pst-color-inline-code-links: var(--pst-color-link);
60+
/* ↓↓↓ make sure new secondary (hover) color propogates to hovering on table rows */
61+
--pst-color-table-row-hover-bg: var(--pst-color-secondary-bg);
3662
/* topbar logo links */
3763
--mne-color-github: rgb(240, 246, 252); /* from their logo SVG */
3864
--mne-color-discourse: #FFF9AE; /* from their logo SVG */
@@ -41,8 +67,6 @@ html[data-theme="dark"] {
4167
--copybtn-opacity: 0.25;
4268
/* card header bg color */
4369
--mne-color-card-header: rgba(255, 255, 255, 0.2);
44-
/* section headings */
45-
--mne-color-heading: #b8cbe0;
4670
/* sphinx-gallery overrides */
4771
--sg-download-a-background-color: var(--pst-color-primary);
4872
--sg-download-a-background-image: unset;
@@ -52,9 +76,6 @@ html[data-theme="dark"] {
5276
--sg-download-a-hover-box-shadow-1: none;
5377
--sg-download-a-hover-box-shadow-2: none;
5478
}
55-
h1, h2, h3, h4, h5, h6 {
56-
color: var(--mne-color-heading);
57-
}
5879

5980
/* ************************************************************ Sphinx fixes */
6081

@@ -161,20 +182,45 @@ iframe.sg_report {
161182
top: 0;
162183
}
163184

164-
/* TODO: Either pydata-sphinx-theme (for using Bootstrap) or sphinx-gallery (for adding table formatting) should fix this */
165-
.table-striped-columns>:not(caption)>tr>:nth-child(2n),.table-striped>tbody>tr:nth-of-type(odd)>* {
166-
--bs-table-accent-bg: var(--bs-table-striped-bg);
185+
/* ******************************************************** HTML repr tables */
186+
187+
/* make table responsive to pydata-sphinx-theme's light/dark mode */
188+
.table > :not(caption) > * > * {
167189
color: var(--pst-color-text-base);
168190
}
169-
.table-hover>tbody>tr:hover>* {
170-
--bs-table-accent-bg: var(--bs-table-hover-bg);
171-
color: var(--pst-color-text-base);
191+
.mne-repr-table tbody tr:hover {
192+
background-color: var(--pst-color-table-row-hover-bg);
172193
}
173-
.rendered_html table {
174-
color: var(--pst-color-text-base);
194+
.mne-repr-section-toggle > button > svg > path {
195+
fill: var(--pst-color-text-base);
175196
}
176-
177-
197+
/* make the expand/collapse button look nicer */
198+
.mne-repr-section-toggle > button {
199+
padding: 20%;
200+
}
201+
/* make section header rows more distinct (and harmonize with pydata-sphinx-theme table
202+
style in the process). Color copied from pydata-sphinx-theme; 2px copied from bootstrap.
203+
*/
204+
.mne-repr-table th {
205+
border-bottom: 2px solid var(--pst-color-primary);
206+
}
207+
/* harmonize the channel names buttons with the rest of the table */
208+
.mne-ch-names-btn {
209+
font-size: inherit;
210+
padding: 0.25rem;
211+
min-width: 1.5rem;
212+
font-weight: bold;
213+
}
214+
/*
215+
.mne-ch-names-btn:hover {
216+
background-color: var(--pst-color-);
217+
text-decoration: underline;
218+
}
219+
.mne-ch-names-btn:focus-visible {
220+
outline: 0.1875rem solid var(--pst-color-accent);
221+
outline-offset: 0.1875rem;
222+
}
223+
*/
178224
/* ***************************************************** sphinx-design fixes */
179225
p.btn a {
180226
color: unset;

Diff for: doc/changes/devel/12366.newfeature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for `dict` type argument ``ref_channels`` to :func:`mne.set_eeg_reference`, to allow flexible re-referencing (e.g. ``raw.set_eeg_reference(ref_channels={'A1': ['A2', 'A3']})`` will set the new A1 data to be ``A1 - mean(A2, A3)``), by `Alex Lepauvre`_ and `Qian Chu`_ and `Daniel McCloy`_.

Diff for: doc/changes/devel/12843.bugfix.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixed a bug where split FIF files that were read and then appended to other
2+
:class:`mne.io.Raw` instances had their ``BAD boundary`` annotations incorrectly offset
3+
in samples by the number of split files, by `Eric Larson`_.

Diff for: doc/changes/devel/12843.other.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve handling of filenames in ``raw.filenames`` by using :class:`~pathlib.Path` instead of :class:`str`, by `Mathieu Scheltienne`_.

Diff for: doc/changes/devel/12844.other.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve automatic figure scaling of :func:`mne.viz.plot_events`, and event_id and count overview legend when a high amount of unique events is supplied, by `Stefan Appelhoff`_.

Diff for: doc/changes/devel/12846.bugfix.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Enforce SI units for Eyetracking data (eyegaze data should be radians of visual angle, not pixels. Pupil size data should be meters). Updated tutorials so demonstrate how to convert data to SI units before analyses (:gh:`12846`` by `Scott Huberty`_)
1+
Enforce SI units for Eyetracking data (eyegaze data should be radians of visual angle, not pixels. Pupil size data should be meters).
2+
Updated tutorials so demonstrate how to convert data to SI units before analyses, by `Scott Huberty`_.

Diff for: doc/changes/devel/12862.other.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:meth:`mne.preprocessing.ICA.find_bads_muscle` can now be run when passing an ``inst`` without sensor positions. However, it will just use the first of three criteria (slope) to find muscle-related ICA components, by `Stefan Appelhoff`_.

Diff for: doc/changes/devel/12871.newfeature.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added the ``title`` argument to :func:`mne.viz.create_3d_figure`, and
2+
``color`` and ``position`` arguments to :func:`mne.viz.set_3d_title`, by `Eric Larson`_.

Diff for: doc/changes/devel/12875.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix bug where invalid data types (e.g., ``np.ndarray``s) could be used in some
2+
:class:`mne.io.Info` fields like ``info["subject_info"]["weight"]``, by `Eric Larson`_.

Diff for: doc/changes/devel/12877.bugfix.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
When creating a :class:`~mne.time_frequency.SpectrumArray`, the array shape check now
2+
compares against the total of both 'good' and 'bad' channels in the provided
3+
:class:`~mne.Info` (previously only good channels were checked), by
4+
`Mathieu Scheltienne`_.

Diff for: doc/changes/devel/12884.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where :ref:`mne coreg` would always show MEG channels even if the "MEG Sensors" checkbox was disabled, by `Eric Larson`_.

Diff for: doc/changes/devel/12901.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:class:`mne.Report` HDF5 files are now written in ``mode='a'`` (append) to allow users to store other data in the HDF5 files, by `Eric Larson`_.

Diff for: doc/changes/devel/12901.newfeature.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Improved reporting and plotting options:
2+
3+
- :meth:`mne.Report.add_projs` can now plot with :func:`mne.viz.plot_projs_joint` rather than :func:`mne.viz.plot_projs_topomap`
4+
- :class:`mne.Report` now has attributes ``img_max_width`` and ``img_max_res`` that can be used to control image scaling.
5+
- :class:`mne.Report` now has an attribute ``collapse`` that allows collapsing sections and/or subsections by default.
6+
- :func:`mne.viz.plot_head_positions` now has a ``totals=True`` option to show the total distance and angle of the head.
7+
8+
Changes by `Eric Larson`_.

Diff for: doc/changes/names.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.. _Alex Ciok: https://github.com/alexCiok
1111
.. _Alex Gramfort: https://alexandre.gramfort.net
1212
.. _Alex Kiefer: https://home.alexk101.dev
13-
.. _Alex Lepauvre: https://github.com/AlexLepauvre
13+
.. _Alex Lepauvre: https://github.com/AlexLepauvre
1414
.. _Alex Rockhill: https://github.com/alexrockhill/
1515
.. _Alexander Rudiuk: https://github.com/ARudiuk
1616
.. _Alexandre Barachant: https://alexandre.barachant.org
@@ -22,7 +22,7 @@
2222
.. _Andrew Quinn: https://github.com/ajquinn
2323
.. _Aniket Pradhan: https://github.com/Aniket-Pradhan
2424
.. _Anna Padee: https://github.com/apadee/
25-
.. _Annalisa Pascarella: https://www.dima.unige.it/~pascarel/html/cv.html
25+
.. _Annalisa Pascarella: https://www.iac.cnr.it/personale/annalisa-pascarella
2626
.. _Anne-Sophie Dubarry: https://github.com/annesodub
2727
.. _Antoine Gauthier: https://github.com/Okamille
2828
.. _Antti Rantala: https://github.com/Odingod
@@ -206,7 +206,7 @@
206206
.. _Nathalie Gayraud: https://github.com/ngayraud
207207
.. _Naveen Srinivasan: https://github.com/naveensrinivasan
208208
.. _Nick Foti: https://nfoti.github.io
209-
.. _Nick Ward: https://www.ucl.ac.uk/ion/departments/sobell/Research/NWard
209+
.. _Nick Ward: https://profiles.ucl.ac.uk/10827-nick-ward
210210
.. _Nicolas Barascud: https://github.com/nbara
211211
.. _Nicolas Fourcaud-Trocmé: https://www.crnl.fr/fr/user/316
212212
.. _Niels Focke: https://neurologie.umg.eu/forschung/arbeitsgruppen/epilepsie-und-bildgebungsforschung
@@ -261,7 +261,7 @@
261261
.. _Samuel Louviot: https://github.com/Sam54000
262262
.. _Samuel Powell: https://github.com/samuelpowell
263263
.. _Santeri Ruuskanen: https://github.com/ruuskas
264-
.. _Sara Sommariva: https://www.dima.unige.it/~sommariva/
264+
.. _Sara Sommariva: https://github.com/sarasommariva
265265
.. _Sawradip Saha: https://sawradip.github.io/
266266
.. _Scott Huberty: https://orcid.org/0000-0003-2637-031X
267267
.. _Sebastiaan Mathot: https://www.cogsci.nl/smathot

Diff for: doc/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"mne-gui-addons": ("https://mne.tools/mne-gui-addons", None),
167167
"picard": ("https://pierreablin.github.io/picard/", None),
168168
"eeglabio": ("https://eeglabio.readthedocs.io/en/latest", None),
169-
"pybv": ("https://pybv.readthedocs.io/en/latest/", None),
169+
"pybv": ("https://pybv.readthedocs.io/en/latest", None),
170170
}
171171
intersphinx_mapping.update(
172172
get_intersphinx_mapping(
@@ -648,6 +648,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
648648
"https://doi.org/10.1093/", # academic.oup.com/sleep/
649649
"https://doi.org/10.1098/", # royalsocietypublishing.org
650650
"https://doi.org/10.1101/", # www.biorxiv.org
651+
"https://doi.org/10.1103", # journals.aps.org/rmp
651652
"https://doi.org/10.1111/", # onlinelibrary.wiley.com/doi/10.1111/psyp
652653
"https://doi.org/10.1126/", # www.science.org
653654
"https://doi.org/10.1137/", # epubs.siam.org
@@ -681,6 +682,9 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
681682
# Too slow
682683
"https://speakerdeck.com/dengemann/",
683684
"https://www.dtu.dk/english/service/phonebook/person",
685+
"https://www.gnu.org/software/make/",
686+
"https://www.macports.org/",
687+
"https://hastie.su.domains/CASI",
684688
# SSL problems sometimes
685689
"http://ilabs.washington.edu",
686690
"https://psychophysiology.cpmc.columbia.edu",

0 commit comments

Comments
 (0)