Skip to content

Commit 2549205

Browse files
Merge branch 'main' into doc-ref-channel-clarification
2 parents 6e49874 + 187e6c9 commit 2549205

63 files changed

Lines changed: 1869 additions & 265 deletions

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/tests.yml

Lines changed: 15 additions & 31 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,36 +119,21 @@ 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)
157139
- uses: astral-sh/setup-uv@v8.1.0
@@ -162,7 +144,9 @@ jobs:
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)

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: 11 additions & 38 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'
@@ -141,19 +141,10 @@ stages:
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"
@@ -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'
@@ -292,12 +274,3 @@ stages:
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

doc/changes/dev/13584.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adopting the diataxis framework by improving the phantom dipole tutorial, by `Carina Forster`_.

doc/changes/dev/13870.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix handling of optional dependencies that don't specify a version attribute, by :newcontrib:`Baris Talar`.

doc/changes/dev/13881.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed typos in error messages when reading measurement info, by :newcontrib:`Seth Bashford`.

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
.. _Asish Panda: https://github.com/kaichogami
3737
.. _Austin Hurst: https://github.com/a-hurst
3838
.. _Ayushi Satodiya: https://github.com/ayuclan
39+
.. _Baris Talar: https://github.com/baris-talar
3940
.. _Beige Jin: https://github.com/BeiGeJin
4041
.. _Ben Beasley: https://github.com/musicinmybrain
4142
.. _Benedikt Ehinger: https://www.benediktehinger.de
@@ -311,6 +312,7 @@
311312
.. _Sebastian Major: https://github.com/major-s
312313
.. _Sena Er: https://github.com/sena-neuro
313314
.. _Senwen Deng: https://snwn.de
315+
.. _Seth Bashford: https://github.com/sbashford
314316
.. _Seyed Yahya Shirazi: https://neuromechanist.github.io
315317
.. _Sheraz Khan: https://github.com/SherazKhan
316318
.. _Shresth Keshari: https://github.com/shresth-keshari

doc/development/contributing.rst

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,49 @@ change, and append additional PR numbers in parentheticals with the ``:gh:`` rol
661661
662662
Short description of the changes, by `Firstname Lastname`_. (:gh:`12346`)
663663
664-
Test locally before opening pull requests (PRs)
665-
-----------------------------------------------
666-
667-
MNE-Python uses `continuous integration`_ (CI) to ensure code quality and
668-
test across multiple installation targets. However, the CIs are often slower
669-
than testing locally, especially when other contributors also have open PRs
670-
(which is basically always the case). Therefore, do not rely on the CIs to
671-
catch bugs and style errors for you; :ref:`run the tests locally <run-tests>`
664+
Continuous integration (CI) and local testing before opening a PR
665+
-----------------------------------------------------------------
666+
667+
Continuous integration (CI) uses automated systems to run tests and checks on your code
668+
whenever you open or update a pull request.
669+
MNE-Python uses `continuous integration`_ (CI) to ensure code quality,
670+
test across multiple platforms, and automatically validate pull requests.
671+
However, CI runs are slower than testing locally and some of them cost money to run.
672+
Therefore, *do not rely on the CIs to catch bugs and style errors for you*;
673+
:ref:`run the tests locally <run-tests>`
672674
instead before opening a new PR and before each time you push additional
673675
changes to an already-open PR.
674676

677+
MNE-Python uses the following CI services:
678+
679+
- `GitHub Actions`_ and `Azure`_ for testing code across platforms
680+
- `CodeCov`_ checks how much of the code is tested
681+
- `CircleCI`_ for building the documentation
682+
683+
If you are contributing for the first time, you may notice that `Github Actions`_
684+
jobs do not start automatically, or appear as "pending".
685+
This is expected behavior. Github Actions requires **manual approval from a
686+
maintainer** before running jobs submitted by new contributors. This is a
687+
security measure to prevent misuse of CI resources.
688+
689+
As a result:
690+
691+
- Github Actions jobs may remain in a *pending* or *not running* state
692+
- This does **not** indicate a problem with your code
693+
694+
Once you have at least one PR merged into the MNE-Python repository, future
695+
contributions will not require manual approval.
696+
697+
`CircleCI`_ will not build the documentation unless the GitHub account of the PR's most recent commit
698+
is associated with a CircleCI account. Creating one is easy and free,
699+
choose "login with GitHub" on `CircleCI`_ to get started.
700+
If you do not do this, it will show up as a failing CI job.
701+
702+
Before opening or updating a PR, check locally:
703+
704+
- that all tests pass (see :ref:`run-tests`)
705+
- the documentation is built without errors if your changes affect it (see :ref:`build-docs`)
706+
- style checks pass (see :ref:`code-style`)
675707

676708
Make tests fast and thorough
677709
----------------------------
@@ -1108,11 +1140,12 @@ it can serve as a useful example of what to expect from the PR review process.
11081140
11091141
.. _miniconda: https://conda.io/en/latest/miniconda.html
11101142
.. _Spyder: https://www.spyder-ide.org/
1111-
.. _continuous integration: https://en.wikipedia.org/wiki/Continuous_integration
1143+
.. _continuous integration: https://about.gitlab.com/topics/ci-cd/
11121144
.. _matplotlib: https://matplotlib.org/
11131145
.. _github actions: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions
11141146
.. _azure: https://dev.azure.com/mne-tools/mne-python/_build/latest?definitionId=1&branchName=main
11151147
.. _CircleCI: https://circleci.com/gh/mne-tools/mne-python
1148+
.. _CodeCov: https://about.codecov.io/
11161149

11171150
.. optipng
11181151

0 commit comments

Comments
 (0)