Skip to content

Commit a190f08

Browse files
authored
Merge branch 'main' into main
2 parents f7c6ede + 893b784 commit a190f08

133 files changed

Lines changed: 3311 additions & 582 deletions

File tree

Some content is hidden

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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
<!--
22
3-
Thanks for contributing a pull request! Please make sure you have read the
4-
[contribution guidelines](https://mne.tools/dev/development/contributing.html)
3+
Thanks for contributing a pull request! Please make sure you have read
4+
[CONTRIBUTING.md](https://github.com/mne-tools/mne-python/blob/main/CONTRIBUTING.md)
5+
and the [detailed contribution guidelines](https://mne.tools/dev/development/contributing.html)
56
before submitting.
67
8+
If you used AI to help prepare this pull request, please pay special attention to
9+
our **Policy on AI Assistance in Contributions** in
10+
[CONTRIBUTING.md](https://github.com/mne-tools/mne-python/blob/main/CONTRIBUTING.md).
11+
Here are some examples of what we expect for "tool, manner, and scope" disclosure:
12+
13+
- "I implemented the code changes myself, and Claude Sonnet 4.6 wrote the test."
14+
- "I prompted Gemini 3.1 Pro to get a first draft implementation, then refined it
15+
manually until I was satisfied."
16+
- "I wrote the code and asked Kimi K2.5 to write the docstring for me."
17+
- "I fed GPT 5.4 the paper where the algorithm is described, and asked it to implement
18+
it for me. Then I had it write an example script using the `sample` dataset, and I
19+
wrote the narrative text of the tutorial myself."
20+
721
Please be aware that we are a loose team of volunteers so patience is
822
necessary. Assistance handling other issues is very welcome. We value
923
all user contributions, no matter how minor they are. If we are slow to

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- run: pip install --upgrade towncrier pygithub gitpython numpy
2222
- run: python ./.github/actions/rename_towncrier/rename_towncrier.py
2323
- run: python ./tools/dev/ensure_headers.py
24-
- uses: autofix-ci/action@7a166d7532b277f34e16238930461bf77f9d7ed8
24+
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v4
47+
uses: github/codeql-action/init@v4.35.2
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v4
61+
uses: github/codeql-action/autobuild@v4.35.2
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,4 +71,4 @@ jobs:
7171
# ./location_of_script_within_repo/buildscript.sh
7272

7373
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v4
74+
uses: github/codeql-action/analyze@v4.35.2

.github/workflows/spec_zero.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
timeout-minutes: 10
4242
with:
4343
detached: true
44-
- uses: astral-sh/setup-uv@v7
44+
- uses: astral-sh/setup-uv@v8.1.0
4545
with:
4646
version: ">=0.9"
4747
activate-environment: true

.github/workflows/tests.yml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
persist-credentials: false
3131
- uses: actions/setup-python@v6
3232
with:
33-
python-version: '3.13'
33+
python-version: '3.14'
3434
- uses: pre-commit/action@v3.0.1
3535
- run: pip install mypy numpy scipy vulture
3636
- run: mypy
@@ -76,15 +76,12 @@ jobs:
7676
- os: ubuntu-latest
7777
python: '3.13'
7878
kind: conda
79-
- os: macos-latest # arm64 (Apple Silicon): Sequoia
80-
python: '3.13'
81-
kind: mamba
82-
- os: macos-15-intel # intel: Sequoia
79+
- os: macos-latest # arm64
80+
python: '3.14'
81+
kind: pip
82+
- os: macos-15-intel # Intel
8383
python: '3.13'
84-
kind: mamba
85-
- os: windows-latest
86-
python: '3.11'
87-
kind: mamba
84+
kind: pip
8885
- os: ubuntu-latest
8986
python: '3.12'
9087
kind: minimal
@@ -122,47 +119,34 @@ jobs:
122119
- uses: actions/setup-python@v6
123120
with:
124121
python-version: ${{ matrix.python }}
125-
if: startswith(matrix.kind, 'pip')
122+
if: startswith(matrix.kind, 'pip') || matrix.kind == 'minimal'
123+
id: setup-python
124+
# Workaround macOS path behavior with login shells (which puts system Python first)
125+
- run: echo "export PATH=\"$(dirname ${{ steps.setup-python.outputs.python-path }}):$PATH\"" | tee -a ~/.bash_profile # zizmor: ignore[template-injection]
126+
if: startswith(matrix.kind, 'pip') && startswith(matrix.os, 'macos')
126127
# Python (if conda)
127-
- name: Fixes for conda
128-
run: |
129-
# For some reason on Linux we get crashes
130-
if [[ "$RUNNER_OS" == "Linux" ]]; then
131-
sed -i "/numba/d" environment.yml
132-
fi
133-
# And on Windows and macOS PySide6.9.0 segfaults
134-
if [[ "$RUNNER_OS" == "macOS" ]]; then
135-
sed -i "" "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml
136-
sed -i "" "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml
137-
138-
else
139-
sed -i "s/ - PySide6 .*/ - PySide6 =6.9.2/g" environment.yml
140-
sed -i "s/ - vtk .*/ - vtk =9.5.1/g" environment.yml
141-
if [[ "$RUNNER_OS" == "Windows" ]]; then
142-
echo "MNE_IS_OSMESA=true" | tee -a $GITHUB_ENV
143-
fi
144-
fi
145-
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
146128
- uses: mamba-org/setup-micromamba@v3
147129
with:
148130
environment-file: ${{ env.CONDA_ENV }}
149131
environment-name: mne
150-
log-level: ${{ runner.debug == '1' && 'debug' || 'info' }}
132+
log-level: 'info'
151133
create-args: >-
152134
python=${{ env.PYTHON_VERSION }}
153135
-v
154-
if: matrix.kind == 'conda' || matrix.kind == 'mamba'
136+
if: matrix.kind == 'conda'
155137
timeout-minutes: 20
156138
# Python (if old)
157-
- uses: astral-sh/setup-uv@v7
139+
- uses: astral-sh/setup-uv@v8.1.0
158140
with:
159141
version: ">=0.9"
160142
activate-environment: true
161143
cache-dependency-glob: |
162144
**/pylock.ci-old.toml
163145
python-version: ${{ matrix.python }}
164146
if: matrix.kind == 'old'
147+
- run: bash ./tools/github_actions_verify_python.sh "${{ matrix.python }}"
165148
- run: bash ./tools/github_actions_dependencies.sh
149+
timeout-minutes: 10
166150
- run: python ./tools/github_actions_check_old_env.py
167151
if: matrix.kind == 'old'
168152
# Minimal commands on Linux (macOS stalls)

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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.15.10
4+
rev: v0.15.12
55
hooks:
66
- id: ruff-check
77
name: ruff lint mne

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ Users and contributors to MNE-Python are expected to follow our [code of conduct
77

88
The [contributing guide](https://mne.tools/dev/development/contributing.html) has details on the preferred contribution workflow
99
and the recommended system configuration for a smooth contribution/development experience.
10+
11+
12+
Policy on AI Assistance in Contributions
13+
----------------------------------------
14+
Contributing to MNE-Python requires human judgment, contextual understanding, domain knowledge, and familiarity with MNE-Python’s structure and goals. It is not suitable for automatic processing by AI tools.
15+
16+
You may not submit issues or pull requests generated by fully-automated tools. Maintainers reserve the right, at their sole discretion, to close such submissions and to block any account responsible for them.
17+
18+
Review all code or documentation changes assisted by AI tools and make sure you understand all changes and can explain them on request, before submitting them under your name. Do not submit any AI-generated code that you haven’t personally reviewed, understood and tested. Please pay special attention to whether AI-assisted code reproduces specific passages for specialized algorithms, as this may risk license violations.
19+
20+
Please do not paste AI generated text in the description of issues, PRs or in comments as this makes it harder for reviewers to assess your contribution.
21+
If you used AI tools, state so in your PR description and disclose the tools you have used, and the manner and scope of their assistance (see PR template for examples).
22+
23+
PRs that appear to violate this policy will be closed without review. AI usage is an evolving issue with serious repercussions far beyond the scientific software ecosystem. The MNE-Python project reserves the right to change or reverse this policy given the developments in these areas.

azure-pipelines.yml

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ stages:
8282
variables:
8383
AZURE_CI: 'true'
8484
jobs:
85-
- job: Ultraslow_PG
85+
- job: Linux_Ultraslow_PG
8686
pool:
87-
vmImage: 'ubuntu-22.04'
87+
vmImage: 'ubuntu-latest'
8888
variables:
8989
DISPLAY: ':99'
9090
OPENBLAS_NUM_THREADS: '1'
@@ -93,7 +93,7 @@ stages:
9393
MNE_BROWSER_PRECOMPUTE: 'false'
9494
steps:
9595
- bash: |
96-
set -e
96+
set -eo pipefail
9797
./tools/setup_xvfb.sh
9898
sudo apt install -yq tcsh
9999
displayName: 'Install Ubuntu dependencies'
@@ -112,19 +112,19 @@ stages:
112112
addToPath: true
113113
displayName: 'Get Python'
114114
- bash: |
115-
set -e
115+
set -eo pipefail
116116
python -m pip install --progress-bar off --upgrade pip
117117
python -m pip install --progress-bar off "mne-qt-browser[opengl] @ git+https://github.com/mne-tools/mne-qt-browser.git" pyvista scikit-learn python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1,!=6.9.1" pandas neo pymatreader antio defusedxml curryreader pymef
118118
python -m pip uninstall -yq mne
119119
python -m pip install --progress-bar off --upgrade -e . --group=test
120120
displayName: 'Install dependencies with pip'
121121
- bash: |
122-
set -e
122+
set -eo pipefail
123123
mne sys_info -pd
124124
mne sys_info -pd | grep "qtpy .*(PySide6=.*)$"
125125
displayName: Print config
126126
- bash: |
127-
set -e
127+
set -eo pipefail
128128
LD_DEBUG=libs python -c "from PySide6.QtWidgets import QApplication, QWidget; app = QApplication([]); import matplotlib; matplotlib.use('QtAgg'); import matplotlib.pyplot as plt; plt.figure()"
129129
- bash: source tools/get_testing_version.sh
130130
displayName: 'Get testing version'
@@ -133,27 +133,18 @@ stages:
133133
key: $(testing_version)
134134
path: /home/vsts/mne_data
135135
displayName: 'Cache testing data'
136-
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
136+
- bash: ./tools/github_actions_download.sh
137137
displayName: 'Get test data'
138138
- script: pytest -m "ultraslowtest or pgtest" --tb=short --cov=mne --cov-report=xml -vv mne
139139
displayName: 'slow and mne-qt-browser tests'
140140
# Coverage
141141
- bash: bash <(curl -s https://codecov.io/bash)
142142
displayName: 'Codecov'
143143
condition: succeededOrFailed()
144-
- task: PublishTestResults@2
145-
inputs:
146-
testResultsFiles: '**/junit-*.xml'
147-
testRunTitle: 'Publish test results for $(Agent.JobName)'
148-
failTaskOnFailedTests: true
149-
condition: succeededOrFailed()
150-
- task: PublishCodeCoverageResults@2
151-
inputs:
152-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
153144

154-
- job: Qt
145+
- job: Linux_Qt_Bindings
155146
pool:
156-
vmImage: 'ubuntu-22.04'
147+
vmImage: 'ubuntu-latest'
157148
variables:
158149
DISPLAY: ':99'
159150
OPENBLAS_NUM_THREADS: '1'
@@ -169,7 +160,7 @@ stages:
169160
addToPath: true
170161
displayName: 'Get Python'
171162
- bash: |
172-
set -e
163+
set -eo pipefail
173164
python -m pip install --progress-bar off --upgrade pip
174165
python -m pip install --progress-bar off --upgrade --pre --only-binary=\"numpy,scipy,matplotlib,vtk\" numpy scipy matplotlib vtk
175166
python -c "import vtk"
@@ -188,7 +179,7 @@ stages:
188179
key: $(testing_version)
189180
path: /home/vsts/mne_data
190181
displayName: 'Cache testing data'
191-
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
182+
- bash: ./tools/github_actions_download.sh
192183
displayName: 'Get test data'
193184
- bash: |
194185
set -eo pipefail
@@ -223,15 +214,6 @@ stages:
223214
- bash: bash <(curl -s https://codecov.io/bash)
224215
displayName: 'Codecov'
225216
condition: succeededOrFailed()
226-
- task: PublishTestResults@2
227-
inputs:
228-
testResultsFiles: '**/junit-*.xml'
229-
testRunTitle: 'Publish test results for $(Agent.JobName)'
230-
failTaskOnFailedTests: true
231-
condition: succeededOrFailed()
232-
- task: PublishCodeCoverageResults@2
233-
inputs:
234-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
235217

236218
- job: Windows
237219
pool:
@@ -250,9 +232,9 @@ stages:
250232
strategy:
251233
maxParallel: 4
252234
matrix:
253-
3.10 pip:
235+
3.11 pip:
254236
TEST_MODE: 'pip'
255-
PYTHON_VERSION: '3.10'
237+
PYTHON_VERSION: '3.11'
256238
3.13 pip pre:
257239
TEST_MODE: 'pip-pre'
258240
PYTHON_VERSION: '3.13'
@@ -285,19 +267,10 @@ stages:
285267
key: $(testing_version)
286268
path: C:\Users\VssAdministrator\mne_data
287269
displayName: 'Cache testing data'
288-
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
270+
- bash: ./tools/github_actions_download.sh
289271
displayName: 'Get test data'
290272
- script: pytest -m "not (slowtest or pgtest)" --tb=short --cov=mne --cov-report=xml -vv mne
291273
displayName: 'Run tests'
292274
- bash: bash <(curl -s https://codecov.io/bash)
293275
displayName: 'Codecov'
294276
condition: succeededOrFailed()
295-
- task: PublishTestResults@2
296-
inputs:
297-
testResultsFiles: '**/junit-*.xml'
298-
testRunTitle: 'Publish test results for $(Agent.JobName) $(TEST_MODE) $(PYTHON_VERSION)'
299-
failTaskOnFailedTests: true
300-
condition: succeededOrFailed()
301-
- task: PublishCodeCoverageResults@2
302-
inputs:
303-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'

doc/_includes/forward.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,7 @@ EEG forward solution in the sphere model
689689

690690
For examples of using the sphere model when computing the forward model
691691
(using :func:`mne.make_forward_solution`), see :ref:`Brainstorm CTF phantom
692-
dataset tutorial <plt_brainstorm_phantom_ctf_eeg_sphere_geometry>`,
693-
:ref:`Brainstorm Elekta phantom dataset tutorial
694-
<plt_brainstorm_phantom_elekta_eeg_sphere_geometry>`, and
692+
dataset tutorial <plt_brainstorm_phantom_ctf_eeg_sphere_geometry>` and
695693
:ref:`tut-source-alignment-without-mri`.
696694

697695
When the sphere model is employed, the computation of the EEG solution can be
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
It is now possible to concatenate raw objects with :func:`mne.concatenate_raws` as long as they inherit from :class:`~mne.io.BaseRaw`, even if their specific types differ (e.g., :class:`~mne.io.Raw` and :class:`~mne.io.RawArray`), by `Clemens Brunner`_.

0 commit comments

Comments
 (0)