Skip to content

Commit 927bc7a

Browse files
authored
Merge branch 'main' into dev-headsurface
2 parents 34c2533 + 4f53a37 commit 927bc7a

File tree

165 files changed

+2097
-789
lines changed

Some content is hidden

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

165 files changed

+2097
-789
lines changed

.circleci/config.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ jobs:
218218
- restore_cache:
219219
keys:
220220
- data-cache-phantom-kit
221+
- restore_cache:
222+
keys:
223+
- data-cache-ds004388
221224
- run:
222225
name: Get data
223226
# This limit could be increased, but this is helpful for finding slow ones
@@ -252,7 +255,7 @@ jobs:
252255
name: Check sphinx log for warnings (which are treated as errors)
253256
when: always
254257
command: |
255-
! grep "^.* WARNING: .*$" sphinx_log.txt
258+
! grep "^.*\(WARNING\|ERROR\): " sphinx_log.txt
256259
- run:
257260
name: Show profiling output
258261
when: always
@@ -393,6 +396,10 @@ jobs:
393396
key: data-cache-phantom-kit
394397
paths:
395398
- ~/mne_data/MNE-phantom-KIT-data # (1 G)
399+
- save_cache:
400+
key: data-cache-ds004388
401+
paths:
402+
- ~/mne_data/ds004388 # (1.8 G)
396403

397404

398405
linkcheck:

.github/workflows/tests.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -93,37 +93,36 @@ jobs:
9393
with:
9494
qt: true
9595
pyvista: false
96+
wm: false
9697
# Python (if pip)
9798
- uses: actions/setup-python@v5
9899
with:
99100
python-version: ${{ matrix.python }}
100101
if: startswith(matrix.kind, 'pip')
101102
# Python (if conda)
102-
- name: Remove numba and dipy
103-
run: | # TODO: Remove when numba 0.59 and dipy 1.8 land on conda-forge
104-
sed -i '/numba/d' environment.yml
105-
sed -i '/dipy/d' environment.yml
106-
sed -i 's/- mne$/- mne-base/' environment.yml
107-
if: matrix.os == 'ubuntu-latest' && startswith(matrix.kind, 'conda') && matrix.python == '3.12'
103+
- name: Fixes for conda
104+
run: |
105+
# For some reason on Linux we get crashes
106+
if [[ "$RUNNER_OS" == "Linux" ]]; then
107+
sed -i "/numba/d" environment.yml
108+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
109+
sed -i "" "s/ - PySide6 .*/ - PySide6 <6.8/g" environment.yml
110+
fi
111+
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
108112
- uses: mamba-org/setup-micromamba@v2
109113
with:
110114
environment-file: ${{ env.CONDA_ENV }}
111115
environment-name: mne
112116
create-args: >-
113117
python=${{ env.PYTHON_VERSION }}
114-
mamba
115-
nomkl
116118
if: ${{ !startswith(matrix.kind, 'pip') }}
117-
# Make sure we have the right Python
118-
- run: python -c "import platform; assert platform.machine() == 'arm64', platform.machine()"
119-
if: matrix.os == 'macos-14'
120-
- run: ./tools/github_actions_dependencies.sh
119+
- run: bash ./tools/github_actions_dependencies.sh
121120
# Minimal commands on Linux (macOS stalls)
122-
- run: ./tools/get_minimal_commands.sh
121+
- run: bash ./tools/get_minimal_commands.sh
123122
if: startswith(matrix.os, 'ubuntu') && matrix.kind != 'minimal' && matrix.kind != 'old'
124-
- run: ./tools/github_actions_infos.sh
123+
- run: bash ./tools/github_actions_infos.sh
125124
# Check Qt
126-
- run: ./tools/check_qt_import.sh $MNE_QT_BACKEND
125+
- run: bash ./tools/check_qt_import.sh $MNE_QT_BACKEND
127126
if: env.MNE_QT_BACKEND != ''
128127
- name: Run tests with no testing data
129128
run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" --tb=short --cov=mne --cov-report xml -vv -rfE mne/
@@ -133,8 +132,8 @@ jobs:
133132
with:
134133
key: ${{ env.TESTING_VERSION }}
135134
path: ~/mne_data
136-
- run: ./tools/github_actions_download.sh
137-
- run: ./tools/github_actions_test.sh
135+
- run: bash ./tools/github_actions_download.sh
136+
- run: bash ./tools/github_actions_test.sh # for some reason on macOS we need to run "bash X" in order for a failed test run to show up
138137
- uses: codecov/codecov-action@v5
139138
with:
140139
token: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

+4-4
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.8.4
4+
rev: v0.9.1
55
hooks:
66
- id: ruff
77
name: ruff lint mne
@@ -70,19 +70,19 @@ repos:
7070
name: Copy dependency changes from pyproject.toml to environment.yml
7171
language: python
7272
entry: ./tools/hooks/update_environment_file.py
73-
files: pyproject.toml
73+
files: '^(pyproject.toml|tools/hooks/update_environment_file.py)$'
7474
- repo: local
7575
hooks:
7676
- id: dependency-sync
7777
name: Copy core dependencies from pyproject.toml to README.rst
7878
language: python
7979
entry: ./tools/hooks/sync_dependencies.py
80-
files: pyproject.toml
80+
files: '^(pyproject.toml|tools/hooks/sync_dependencies.py)$'
8181
additional_dependencies: ["mne==1.9.0"]
8282

8383
# zizmor
8484
- repo: https://github.com/woodruffw/zizmor-pre-commit
85-
rev: v0.10.0
85+
rev: v1.1.1
8686
hooks:
8787
- id: zizmor
8888

azure-pipelines.yml

+11-14
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ stages:
8888
variables:
8989
DISPLAY: ':99'
9090
OPENBLAS_NUM_THREADS: '1'
91+
MNE_TEST_ALLOW_SKIP: '^.*(PySide6 causes segfaults).*$'
9192
steps:
9293
- bash: |
9394
set -e
@@ -111,7 +112,7 @@ stages:
111112
- bash: |
112113
set -e
113114
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!=6.8.0,!=6.8.0.1"
115+
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 python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1" pandas neo pymatreader antio defusedxml
115116
python -m pip uninstall -yq mne
116117
python -m pip install --progress-bar off --upgrade -e .[test]
117118
displayName: 'Install dependencies with pip'
@@ -132,7 +133,7 @@ stages:
132133
displayName: 'Cache testing data'
133134
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
134135
displayName: 'Get test data'
135-
- script: pytest --error-for-skips -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne
136+
- script: pytest -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml -vv mne
136137
displayName: 'slow and mne-qt-browser tests'
137138
# Coverage
138139
- bash: bash <(curl -s https://codecov.io/bash)
@@ -144,19 +145,18 @@ stages:
144145
testRunTitle: 'Publish test results for $(Agent.JobName)'
145146
failTaskOnFailedTests: true
146147
condition: succeededOrFailed()
147-
- task: PublishCodeCoverageResults@1
148+
- task: PublishCodeCoverageResults@2
148149
inputs:
149-
codeCoverageTool: Cobertura
150150
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
151-
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
152151

153152
- job: Qt
154153
pool:
155154
vmImage: 'ubuntu-22.04'
156155
variables:
157156
DISPLAY: ':99'
158157
OPENBLAS_NUM_THREADS: '1'
159-
TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-report=html --cov-append -vv mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/gui mne/report"
158+
TEST_OPTIONS: "--tb=short --cov=mne --cov-report=xml --cov-append -vv mne/viz/_brain mne/viz/backends mne/viz/tests/test_evoked.py mne/gui mne/report"
159+
MNE_TEST_ALLOW_SKIP: '^.*(PySide6 causes segfaults).*$'
160160
steps:
161161
- bash: ./tools/setup_xvfb.sh
162162
displayName: 'Install Ubuntu dependencies'
@@ -192,6 +192,7 @@ stages:
192192
set -eo pipefail
193193
python -m pip install PyQt6
194194
LD_DEBUG=libs python -c "from PyQt6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()"
195+
displayName: 'Check Qt import'
195196
- bash: |
196197
set -eo pipefail
197198
mne sys_info -pd
@@ -226,11 +227,9 @@ stages:
226227
testRunTitle: 'Publish test results for $(Agent.JobName)'
227228
failTaskOnFailedTests: true
228229
condition: succeededOrFailed()
229-
- task: PublishCodeCoverageResults@1
230+
- task: PublishCodeCoverageResults@2
230231
inputs:
231-
codeCoverageTool: Cobertura
232232
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
233-
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
234233

235234
- job: Windows
236235
pool:
@@ -244,7 +243,7 @@ stages:
244243
PYTHONIOENCODING: 'utf-8'
245244
AZURE_CI_WINDOWS: 'true'
246245
PYTHON_ARCH: 'x64'
247-
timeoutInMinutes: 75
246+
timeoutInMinutes: 80
248247
strategy:
249248
maxParallel: 4
250249
matrix:
@@ -285,7 +284,7 @@ stages:
285284
displayName: 'Cache testing data'
286285
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
287286
displayName: 'Get test data'
288-
- script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml --cov-report=html -vv mne
287+
- script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml -vv mne
289288
displayName: 'Run tests'
290289
- bash: bash <(curl -s https://codecov.io/bash)
291290
displayName: 'Codecov'
@@ -296,8 +295,6 @@ stages:
296295
testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)'
297296
failTaskOnFailedTests: true
298297
condition: succeededOrFailed()
299-
- task: PublishCodeCoverageResults@1
298+
- task: PublishCodeCoverageResults@2
300299
inputs:
301-
codeCoverageTool: Cobertura
302300
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
303-
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'

doc/api/datasets.rst

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Datasets
1818
brainstorm.bst_auditory.data_path
1919
brainstorm.bst_resting.data_path
2020
brainstorm.bst_raw.data_path
21+
default_path
2122
eegbci.load_data
2223
eegbci.standardize
2324
fetch_aparc_sub_parcellation

doc/api/preprocessing.rst

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Projections:
116116
read_ica_eeglab
117117
read_fine_calibration
118118
write_fine_calibration
119+
apply_pca_obs
119120

120121
:py:mod:`mne.preprocessing.nirs`:
121122

doc/api/time_frequency.rst

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Functions that operate on mne-python objects:
3131
.. autosummary::
3232
:toctree: ../generated/
3333

34+
combine_spectrum
35+
combine_tfr
3436
csd_tfr
3537
csd_fourier
3638
csd_multitaper

doc/changes/devel/12828.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed behavior of :func:`mne.viz.plot_source_estimates` where the ``title`` was not displayed properly, by :newcontrib:`Shristi Baral`.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added the option to return taper weights from :func:`mne.time_frequency.tfr_array_multitaper`, and taper weights are now stored in the :class:`mne.time_frequency.BaseTFR` objects, by `Thomas Binns`_.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add PCA-OBS preprocessing for the removal of heart-artefacts from EEG or ESG datasets via :func:`mne.preprocessing.apply_pca_obs`, by :newcontrib:`Emma Bailey` and :newcontrib:`Steinn Hauser Magnusson`.

doc/changes/devel/13048.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix input boxes for the max value not showing when plotting fieldlines with :func:`~mne.viz.plot_evoked_field` when ``show_density=False``, by `Marijn van Vliet`_.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added :func:`mne.time_frequency.combine_tfr` to allow combining TFRs across tapers, by `Thomas Binns`_.

doc/changes/devel/13056.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with saving of anonymized data when helium info is present in measurement info, by `Eric Larson`_.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the function :func:`mne.time_frequency.combine_spectrum` for combining data across :class:`mne.time_frequency.Spectrum` objects, and allow :func:`mne.grand_average` to operate on :class:`mne.time_frequency.Spectrum` objects, by `Thomas Binns`_.

doc/changes/devel/13062.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix computation of time intervals in :func:`mne.preprocessing.compute_fine_calibration` by `Eric Larson`_.

doc/changes/devel/13063.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug in the colorbars created by :func:`mne.viz.plot_evoked_topomap` by `Santeri Ruuskanen`_.

doc/changes/devel/13067.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where taper weights were not correctly applied when computing multitaper power with :meth:`mne.Epochs.compute_tfr` and :func:`mne.time_frequency.tfr_array_multitaper`, by `Thomas Binns`_.

doc/changes/devel/13069.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug cause by unnecessary assertion when loading mixed frequency EDFs without preloading :func:`mne.io.read_raw_edf` by `Simon Kern`_.

doc/changes/names.inc

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
.. _Eberhard Eich: https://github.com/ebeich
7474
.. _Eduard Ort: https://github.com/eort
7575
.. _Emily Stephen: https://github.com/emilyps14
76+
.. _Emma Bailey: https://www.cbs.mpg.de/employees/bailey
7677
.. _Enrico Varano: https://github.com/enricovara/
7778
.. _Enzo Altamiranda: https://www.linkedin.com/in/enzoalt
7879
.. _Eric Larson: https://larsoner.com
@@ -273,6 +274,7 @@
273274
.. _Senwen Deng: https://snwn.de
274275
.. _Seyed Yahya Shirazi: https://neuromechanist.github.io
275276
.. _Sheraz Khan: https://github.com/SherazKhan
277+
.. _Shristi Baral: https://github.com/shristibaral
276278
.. _Silvia Cotroneo: https://github.com/sfc-neuro
277279
.. _Simeon Wong: https://github.com/dtxe
278280
.. _Simon Kern: https://skjerns.de
@@ -283,6 +285,7 @@
283285
.. _Stanislas Chambon: https://github.com/Slasnista
284286
.. _Stefan Appelhoff: https://stefanappelhoff.com
285287
.. _Stefan Repplinger: https://github.com/stfnrpplngr
288+
.. _Steinn Hauser Magnusson: https://github.com/steinnhauser
286289
.. _Steven Bethard: https://github.com/bethard
287290
.. _Steven Bierer: https://github.com/neurolaunch
288291
.. _Steven Gutstein: https://github.com/smgutstein

doc/changes/v1.7.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ Bugfixes
7575
- Fix validation of ``ch_type`` in :func:`mne.preprocessing.annotate_muscle_zscore`, by `Mathieu Scheltienne`_. (`#12444 <https://github.com/mne-tools/mne-python/pull/12444>`__)
7676
- Fix errant redundant use of ``BIDSPath.split`` when writing split raw and epochs data, by `Eric Larson`_. (`#12451 <https://github.com/mne-tools/mne-python/pull/12451>`__)
7777
- Disable config parser interpolation when reading BrainVision files, which allows using the percent sign as a regular character in channel units, by `Clemens Brunner`_. (`#12456 <https://github.com/mne-tools/mne-python/pull/12456>`__)
78-
- - Fix the default color of :meth:`mne.viz.Brain.add_text` to properly contrast with the figure background color, by `Marijn van Vliet`_. (`#12470 <https://github.com/mne-tools/mne-python/pull/12470>`__)
79-
- - Changed default ECoG and sEEG electrode sizes in brain plots to better reflect real world sizes, by `Liberty Hamilton`_ (`#12474 <https://github.com/mne-tools/mne-python/pull/12474>`__)
78+
- Fix the default color of :meth:`mne.viz.Brain.add_text` to properly contrast with the figure background color, by `Marijn van Vliet`_. (`#12470 <https://github.com/mne-tools/mne-python/pull/12470>`__)
79+
- Changed default ECoG and sEEG electrode sizes in brain plots to better reflect real world sizes, by `Liberty Hamilton`_ (`#12474 <https://github.com/mne-tools/mne-python/pull/12474>`__)
8080
- Fixed bugs with handling of rank in :class:`mne.decoding.CSP`, by `Eric Larson`_. (`#12476 <https://github.com/mne-tools/mne-python/pull/12476>`__)
81-
- - Fix reading segmented recordings with :func:`mne.io.read_raw_eyelink` by `Dominik Welke`_. (`#12481 <https://github.com/mne-tools/mne-python/pull/12481>`__)
81+
- Fix reading segmented recordings with :func:`mne.io.read_raw_eyelink` by `Dominik Welke`_. (`#12481 <https://github.com/mne-tools/mne-python/pull/12481>`__)
8282
- Improve compatibility with other Qt-based GUIs by handling theme icons better, by `Eric Larson`_. (`#12483 <https://github.com/mne-tools/mne-python/pull/12483>`__)
83-
- - Fix problem caused by onsets with NaN values using :func:`mne.io.read_raw_eeglab` by `Jacob Woessner`_ (`#12484 <https://github.com/mne-tools/mne-python/pull/12484>`__)
83+
- Fix problem caused by onsets with NaN values using :func:`mne.io.read_raw_eeglab` by `Jacob Woessner`_ (`#12484 <https://github.com/mne-tools/mne-python/pull/12484>`__)
8484
- Fix cleaning of channel names for non vectorview or CTF dataset including whitespaces or dash in their channel names, by `Mathieu Scheltienne`_. (`#12489 <https://github.com/mne-tools/mne-python/pull/12489>`__)
8585
- Fix bug with :meth:`mne.preprocessing.ICA.plot_sources` for ``evoked`` data where the
8686
legend contained too many entries, by `Eric Larson`_. (`#12498 <https://github.com/mne-tools/mne-python/pull/12498>`__)

doc/changes/v1.9.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. _changes_1_9_0:
22

3-
1.9.0 (2024-12-18)
4-
==================
3+
Version 1.9.0 (2024-12-18)
4+
==========================
55

66
Dependencies
77
------------
88

9-
- - Minimum supported dependencies were updated in accordance with SPEC0_, most notably Python 3.10+ is now required. (`#12798 <https://github.com/mne-tools/mne-python/pull/12798>`__)
9+
- Minimum supported dependencies were updated in accordance with SPEC0_, most notably Python 3.10+ is now required. (`#12798 <https://github.com/mne-tools/mne-python/pull/12798>`__)
1010
- Importing from ``mne.decoding`` now explicitly requires ``scikit-learn`` to be installed,
1111
by `Eric Larson`_. (`#12834 <https://github.com/mne-tools/mne-python/pull/12834>`__)
1212
- Compatibility improved for Python 3.13, by `Eric Larson`_. (`#13021 <https://github.com/mne-tools/mne-python/pull/13021>`__)
@@ -63,7 +63,7 @@ New features
6363
- Add option to :func:`mne.preprocessing.fix_stim_artifact` to use baseline average to flatten TMS pulse artifact by `Fahimeh Mamashli`_ and `Padma Sundaram`_ and `Mohammad Daneshzand`_. (`#6915 <https://github.com/mne-tools/mne-python/pull/6915>`__)
6464
- 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`_. (`#12366 <https://github.com/mne-tools/mne-python/pull/12366>`__)
6565
- Add reader for ANT Neuro files in the ``*.cnt`` format with :func:`~mne.io.read_raw_ant`, by `Mathieu Scheltienne`_, `Eric Larson`_ and `Proloy Das`_. (`#12792 <https://github.com/mne-tools/mne-python/pull/12792>`__)
66-
- - Add support for a :class:`mne.transforms.Transform` in the argument ``trans`` of the coregistration GUI called with :func:`mne.gui.coregistration`, by `Mathieu Scheltienne`_. (`#12801 <https://github.com/mne-tools/mne-python/pull/12801>`__)
66+
- Add support for a :class:`mne.transforms.Transform` in the argument ``trans`` of the coregistration GUI called with :func:`mne.gui.coregistration`, by `Mathieu Scheltienne`_. (`#12801 <https://github.com/mne-tools/mne-python/pull/12801>`__)
6767
- :meth:`~mne.io.Raw` and :meth:`~mne.Epochs.save` now return the path to the saved file(s), by `Victor Ferat`_. (`#12811 <https://github.com/mne-tools/mne-python/pull/12811>`__)
6868
- :func:`mne.channels.read_custom_montage` may now read a newer version of the ``.elc`` ASA Electrode file format, by `Stefan Appelhoff`_. (`#12830 <https://github.com/mne-tools/mne-python/pull/12830>`__)
6969
- Added the ``title`` argument to :func:`mne.viz.create_3d_figure`, and

0 commit comments

Comments
 (0)