Skip to content

Commit 7199a84

Browse files
authored
Merge branch 'main' into enh-concatenate-epochsspectrum
2 parents c1fb318 + 4983e96 commit 7199a84

28 files changed

Lines changed: 155 additions & 92 deletions

.github/workflows/spec_zero.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ jobs:
4646
version: ">=0.9"
4747
activate-environment: true
4848
python-version: 3.12
49-
- run: uv pip install packaging requests tomlkit
50-
- run: python ./tools/dev/spec_zero_update_versions.py
49+
- name: Install dependencies
50+
run: uv pip install -e . packaging requests tomlkit
51+
- name: Update tracked dependencies
52+
run: python ./tools/dev/spec_zero_update_versions.py
53+
- name: Sync updated dependencies to README
54+
run: python tools/sync_dependencies.py
5155
- name: Create lockfile for old CI
5256
# uv pip compile requires setting the python version explicitly in the command :(
5357
run: |
@@ -72,7 +76,9 @@ jobs:
7276
git config --global user.email "50266005+mne-bot@users.noreply.github.com"
7377
git config --global user.name "mne[bot]"
7478
git checkout -b spec_zero
75-
git add doc/changes/dev/dependency.rst # one new file, others changed
79+
if [ -f doc/changes/dev/dependency.rst ]; then
80+
git add doc/changes/dev/dependency.rst # one new file, others changed
81+
fi
7682
git commit -am "mne[bot]: Update dependency specifiers"
7783
git push origin spec_zero
7884
PR_NUM=$(gh pr create --base main --head spec_zero --title "MAINT: Update dependency specifiers" --body "Created by spec_zero [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}). <br> <br> *Adjustments may need to be made to shims in \`mne/fixes.py\` and elswhere in this or another PR. \`make -C tools/dev dep\` is a good starting point for finding potential updates.*")

.pre-commit-config.yaml

Lines changed: 2 additions & 14 deletions
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.9
4+
rev: v0.15.10
55
hooks:
66
- id: ruff-check
77
name: ruff lint mne
@@ -71,28 +71,16 @@ repos:
7171
language: python
7272
entry: ./tools/hooks/update_environment_file.py
7373
files: '^(pyproject.toml|tools/hooks/update_environment_file.py)$'
74-
- repo: local
75-
hooks:
76-
- id: dependency-sync
77-
name: Copy core dependencies from pyproject.toml to README.rst
78-
language: python
79-
entry: ./tools/hooks/sync_dependencies.py
80-
files: '^(pyproject.toml|tools/hooks/sync_dependencies.py)$'
81-
additional_dependencies: ["mne==1.12.0"]
8274

8375
# zizmor
8476
- repo: https://github.com/woodruffw/zizmor-pre-commit
85-
rev: v1.23.1
77+
rev: v1.24.1
8678
hooks:
8779
- id: zizmor
8880
args: [--fix]
8981
# We correctly use pull_request_trigger, and need Zizmor 2.0+ to configure the ignore
9082
exclude: ^.github/workflows/automerge.yml
9183

92-
# these should *not* be run on CIs:
93-
ci:
94-
skip: [dependency-sync] # needs MNE to work, which exceeds the free tier space alloc.
95-
9684
# The following are too slow to run on local commits, so let's only run on CIs:
9785
#
9886
# - repo: https://github.com/pre-commit/mirrors-mypy

doc/changes/dev/13673.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reorganized EDF submodule structure by moving private functionality into the public ``mne.io`` namespace to improve module consistency and avoid exposing private modules in the Credits page, by `Aniket Singh Yadav`_.

doc/changes/dev/13825.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved colocated OPM topomap handling by recognizing additional OPM coil types (FieldLine and Kernel), by `Pragnya Khandelwal`_.

doc/changes/dev/13843.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where logging messages were sometimes errantly printed, by `Eric Larson`_.

doc/changes/v1.12.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Bugfixes
2323
- Fix bug where :func:`mne.viz.plot_raw` would access incorrect matplotlib attributes, by :newcontrib:`Thomas Caswell`. (`#13606 <https://github.com/mne-tools/mne-python/pull/13606>`__)
2424
- Allow reading alternative nasion label ("Nz") in SNIRF files when parsing landmarkPos3D, by :newcontrib:`Aniket Singh Yadav`. (`#13672 <https://github.com/mne-tools/mne-python/pull/13672>`__)
2525
- Change default-pick 'data' for "eyegaze" to false, following existing documentation. by :newcontrib:`Benedikt Ehinger`. (`#13723 <https://github.com/mne-tools/mne-python/pull/13723>`__)
26-
by :newcontrib:`Christoph Huber-Huber`. (`#13759 <https://github.com/mne-tools/mne-python/pull/13759>`__)
2726
- Fix bug in when reading EDF/GDF files where non-positive lowpass values were not handled correctly, now mapping them to the Nyquist frequency to prevent errors during plotting, by :newcontrib:`Hansuja Budhiraja`. (`#13769 <https://github.com/mne-tools/mne-python/pull/13769>`__)
2827
- Clearer error message when no ECG events are found in :func:`~mne.preprocessing.find_ecg_events`, by :newcontrib:`Hansuja Budhiraja`. (`#13771 <https://github.com/mne-tools/mne-python/pull/13771>`__)
2928
- Fix bug in 3D overlay compositing that could produce NaN RGBA values when the resulting alpha is zero, by `Pragnya Khandelwal`_. (`#13714 <https://github.com/mne-tools/mne-python/pull/13714>`__)
3029
- Make :meth:`~mne.io.Raw.interpolate_bads` method flexible (ignore, warn, raise) about how to handle interpolation of channels with invalid positions, by :newcontrib:`Himanshu Mahor`. (`#13518 <https://github.com/mne-tools/mne-python/pull/13518>`__)
3130
- Fix bug where outdated ``seghead.mgz`` files were reused in :func:`mne.bem.make_scalp_surfaces`. Add a new parameter ``reuse_seghead`` to control whether to reuse existing ``seghead.mgz`` files, by `Victor Ferat`_. (`#13024 <https://github.com/mne-tools/mne-python/pull/13024>`__)
31+
- When interpolating from axial to planar gradiometers, set info fields "chs", "ch_names", and "nchan", according to the interpolated data, reset info fields "device_info", "helium_info", "gantry_angle", "ctf_head_t", "dev_ctf_t", "bads", "projs", and "comps" to [] or None, and preserve all remaining info fields. by :newcontrib:`Christoph Huber-Huber`. (`#13759 <https://github.com/mne-tools/mne-python/pull/13759>`__)
3232
- Clarified an internal forward-model invariant in ``mne.forward._lead_dots`` by asserting that ``rref`` is ``None`` on the current code path, by :newcontrib:`Pragnya Khandelwal`. (`#13764 <https://github.com/mne-tools/mne-python/pull/13764>`__)
3333
- Fix bug preventing :func:`mne.time_frequency.read_spectrum` from reading saved :class:`mne.time_frequency.Spectrum` objects created from :meth:`mne.time_frequency.EpochsSpectrum.average`, by `Thomas Binns`_. (`#13521 <https://github.com/mne-tools/mne-python/pull/13521>`__)
3434
- Fix bug where :func:`mne.chpi.refit_hpi` did not take ``gof_limit`` into account when fitting HPI order, by `Eric Larson`_ (`#13525 <https://github.com/mne-tools/mne-python/pull/13525>`__)
@@ -50,9 +50,6 @@ Bugfixes
5050
- Fix annotation removal logic in matplotlib based figures to correctly handle non-contiguous visible annotations, by `Johannes Herforth`_. (`#13703 <https://github.com/mne-tools/mne-python/pull/13703>`__)
5151
- Support mixed-type concatenation of :class:`mne.Annotations` and :class:`mne.HEDAnnotations`, preserving HED strings in ``extras["HED"]``, by `Bruno Aristimunha`_. (`#13736 <https://github.com/mne-tools/mne-python/pull/13736>`__)
5252
- Improved handling of dropped epochs in :func:`mne.viz.plot_ica_properties` and :meth:`mne.preprocessing.ICA.plot_properties`, allowing plots to be generated even with many bad annotations, by `Clemens Brunner`_. (`#13746 <https://github.com/mne-tools/mne-python/pull/13746>`__)
53-
- When interpolating from axial to planar gradiometers, set info fields "chs", "ch_names", and "nchan", according to the interpolated data,
54-
reset info fields "device_info", "helium_info", "gantry_angle", "ctf_head_t", "dev_ctf_t", "bads", "projs", and "comps" to [] or None, and
55-
preserve all remaining info fields.
5653
- Avoid some unnecessary computations when ``n_jobs=None`` is equivalent to ``n_jobs=1``, by `Simon Kern`_. (`#13777 <https://github.com/mne-tools/mne-python/pull/13777>`__)
5754
- Fix clipped annotations and x-axis label in :meth:`mne.io.Raw.plot`, by `Clemens Brunner`_. (`#13787 <https://github.com/mne-tools/mne-python/pull/13787>`__)
5855
- Fix bug with reading large CNT files by adding ``recompute_n_samples`` to :func:`mne.io.read_raw_cnt` with stricter ``data_format`` handling by `Teon Brooks`_ and `Eric Larson`_. (`#13548 <https://github.com/mne-tools/mne-python/pull/13548>`__)
@@ -67,7 +64,7 @@ New features
6764
- Add support for multi-wavelength NIRS processing to :func:`mne.preprocessing.nirs.beer_lambert_law`, :func:`mne.preprocessing.nirs.scalp_coupling_index`, and SNIRF reader :func:`mne.io.read_raw_snirf`, by :newcontrib:`Tamas Fehervari`. (`#13408 <https://github.com/mne-tools/mne-python/pull/13408>`__)
6865
- Add an optional ``show_channel_names`` parameter to :meth:`mne.viz.plot_alignment` to overlay channel labels at sensor locations in the 3D alignment view, by :newcontrib:`Aman Srivastava`. (`#13570 <https://github.com/mne-tools/mne-python/pull/13570>`__)
6966
- Add support for reading BCI2000 ``.dat`` files via :func:`mne.io.read_raw_bci2k`, and an example :file:`examples/io/read_bci2k.py` for downloading and visualizing BCI2000 data, by :newcontrib:`Hansuja Budhiraja`. (`#13699 <https://github.com/mne-tools/mne-python/pull/13699>`__)
70-
- Add support for scalar or per-vertex ``alpha`` (shape ``(n_vertices,)``) in distributed overlays, including validation/errors for invalid shapes, tests, and a visualization example in ``examples/visualization/brain.py`` using :meth:`mne.viz.Brain.add_data`, by :newcontrib:`Pragnya Khandelwal`. (:gh:`13706`) (`#13706 <https://github.com/mne-tools/mne-python/pull/13706>`__)
67+
- Add support for scalar or per-vertex ``alpha`` (shape ``(n_vertices,)``) in distributed overlays, including validation/errors for invalid shapes, tests, and a visualization example in ``examples/visualization/brain.py`` using :meth:`mne.viz.Brain.add_data`, by :newcontrib:`Pragnya Khandelwal`. (`#13706 <https://github.com/mne-tools/mne-python/pull/13706>`__)
7168
- Added ``cmap`` parameter to ``Evoked.animate_topomap`` to allow user-specified colormaps., by :newcontrib:`Hansuja Budhiraja`. (`#13756 <https://github.com/mne-tools/mne-python/pull/13756>`__)
7269
- Allow per-channel color overrides in :func:`mne.viz.plot_raw` via channel name keys in the ``color`` dict, by :newcontrib:`Hansuja Budhiraja`. (`#13765 <https://github.com/mne-tools/mne-python/pull/13765>`__)
7370
- Add example showing how to interoperate with R using ``rpy2``, by :newcontrib:`Aman Srivastava`. (`#13729 <https://github.com/mne-tools/mne-python/pull/13729>`__)
@@ -83,7 +80,7 @@ Other changes
8380
- Created a quality control report tutorial :ref:`tut-qc-report`, by :newcontrib:`varshaa-1616`. (`#13532 <https://github.com/mne-tools/mne-python/pull/13532>`__)
8481
- Improved docs for :func:`mne.io.read_raw_nirx`, by :newcontrib:`Natneal B`. (`#13541 <https://github.com/mne-tools/mne-python/pull/13541>`__)
8582
- Refactor f-strings in ``mne/tests/test_import_nesting.py``, by :newcontrib:`Shruti Bhale`. (`#13551 <https://github.com/mne-tools/mne-python/pull/13551>`__)
86-
- Remove legacy Python-version compatibility checks in ``mne.utils.misc._empty_hash`` now that ``usedforsecurity=False`` is always supported, by :newcontrib:`Varun Kasyap Pentamaraju` (:gh:`13566`). (`#13566 <https://github.com/mne-tools/mne-python/pull/13566>`__)
83+
- Remove legacy Python-version compatibility checks in ``mne.utils.misc._empty_hash`` now that ``usedforsecurity=False`` is always supported, by :newcontrib:`Varun Kasyap Pentamaraju`. (`#13566 <https://github.com/mne-tools/mne-python/pull/13566>`__)
8784
- Add optional low-variance ("hat") regularization to :func:`mne.stats.f_oneway` via new ``sigma`` and ``method`` parameters, by :newcontrib:`Aniket Singh Yadav`. (`#13698 <https://github.com/mne-tools/mne-python/pull/13698>`__)
8885
- Improve documentation of return values to clarify that methods typically return the original instance type for chaining purposes, by :newcontrib:`Aniket Singh Yadav`. (`#13674 <https://github.com/mne-tools/mne-python/pull/13674>`__)
8986
- Examples Using <some-method> section quirk fix in documentation, by :newcontrib:`Himanshu Mahor`. (`#13596 <https://github.com/mne-tools/mne-python/pull/13596>`__)

doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,13 @@
180180
"picard": ("https://mind-inria.github.io/picard/", None),
181181
"eeglabio": ("https://eeglabio.readthedocs.io/en/latest", None),
182182
"pybv": ("https://pybv.readthedocs.io/en/latest", None),
183-
# should go back below after https://github.com/dipy/dipy/issues/3870 is fixed
184-
"dipy": ("https://docs.dipy.org/1.12.0", None),
185183
}
186184
intersphinx_mapping.update(
187185
get_intersphinx_mapping(
188186
packages=set(
189187
"""
190188
imageio matplotlib numpy pandas python scipy statsmodels sklearn numba joblib nibabel
191-
seaborn patsy pyvista nilearn pyqtgraph
189+
seaborn patsy pyvista dipy nilearn pyqtgraph
192190
""".strip().split()
193191
),
194192
)

doc/install/installers.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ Platform-specific installers
1717
:class-content: text-center
1818
:name: install-linux
1919

20-
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0/MNE-Python-1.12.0_0-Linux.sh
20+
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0-post1/MNE-Python-1.12.0_1-Linux.sh
2121
:ref-type: ref
2222
:color: primary
2323
:shadow:
2424
:class: font-weight-bold mt-3 install-download-button
2525

2626
|cloud-arrow-down| |ensp| Download for Linux
2727

28-
**Supported platforms:** Ubuntu 18.04 (Bionic Beaver) and newer
28+
**Supported platforms:** Ubuntu 20.04 (Focal Fossa) and newer
2929

3030
Run the installer in a terminal via:
3131

3232
.. code-block:: console
3333
34-
$ sh ./MNE-Python-1.12.0_0-Linux.sh
34+
$ sh ./MNE-Python-1.12.0_1-Linux.sh
3535
3636
3737
.. tab-item:: macOS (Intel)
3838
:class-content: text-center
3939
:name: install-macos-intel
4040

41-
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0/MNE-Python-1.12.0_0-macOS_Intel.pkg
41+
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0-post1/MNE-Python-1.12.0_1-macOS_Intel.pkg
4242
:ref-type: ref
4343
:color: primary
4444
:shadow:
@@ -54,7 +54,7 @@ Platform-specific installers
5454
:class-content: text-center
5555
:name: install-macos-apple
5656

57-
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0/MNE-Python-1.12.0_0-macOS_M1.pkg
57+
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0-post1/MNE-Python-1.12.0_1-macOS_M1.pkg
5858
:ref-type: ref
5959
:color: primary
6060
:shadow:
@@ -70,7 +70,7 @@ Platform-specific installers
7070
:class-content: text-center
7171
:name: install-windows
7272

73-
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0/MNE-Python-1.12.0_0-Windows.exe
73+
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.12.0-post1/MNE-Python-1.12.0_1-Windows.exe
7474
:ref-type: ref
7575
:color: primary
7676
:shadow:
@@ -128,6 +128,14 @@ bundles to the ``Applications`` folder on macOS.
128128
particularly long on Apple Silicon-based computers. Subsequent runs should
129129
usually be much faster.
130130

131+
The installer sets up a standard ``conda`` environment. If you want to activate the
132+
environment manually (e.g., in headless setups) you can do as you would for any other
133+
conda environment:
134+
135+
.. code-block:: bash
136+
137+
$ source /path-to-installation-dir/bin/activate
138+
131139
Uninstallation
132140
^^^^^^^^^^^^^^
133141

@@ -156,7 +164,7 @@ To remove the MNE-Python distribution provided by our installers above:
156164
.. code-block:: bash
157165
158166
$ which python
159-
/home/username/mne-python/1.12.0_0/bin/python
167+
/home/username/mne-python/1.12.0_1/bin/python
160168
$ rm -Rf /home/$USER/mne-python
161169
$ rm /home/$USER/.local/share/applications/mne-python-*.desktop
162170
@@ -170,7 +178,7 @@ To remove the MNE-Python distribution provided by our installers above:
170178
.. code-block:: bash
171179
172180
$ which python
173-
/Users/username/Applications/MNE-Python/1.12.0_0/.mne-python/bin/python
181+
/Users/username/Applications/MNE-Python/1.12.0_1/.mne-python/bin/python
174182
$ rm -Rf /Users/$USER/Applications/MNE-Python # if user-specific
175183
$ rm -Rf /Applications/MNE-Python # if system-wide
176184

doc/sphinxext/credit_tools.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ def generate_credit_rst(app=None, *, verbose=False):
315315
logo/LICENSE doc/credit.rst
316316
""".strip().split():
317317
globs[key] = "null"
318+
# A few remaps
319+
globs["mne/io/edf/_open.py"] = "mne.io"
320+
globs["mne/_edf/open.py"] = "mne.io"
318321
# Now onto the actual module organization
319322
root_path = pathlib.Path(mne.__file__).parent
320323
mod_file_map = dict()
@@ -392,15 +395,30 @@ def generate_credit_rst(app=None, *, verbose=False):
392395
other_files.add(fname)
393396
mod = "other"
394397
for e, pm in counts.items():
395-
if mod == "mne._fiff":
396-
raise RuntimeError
398+
# Assert no private (_-prefixed) submodules appear without a redirect
399+
if mod.startswith("mne.") and mod.split(".")[-1].startswith("_"):
400+
raise RuntimeError(
401+
f"Private submodule {mod!r} found in credit page for {fname!r}. "
402+
"Add an override in credit_tools.py to remap it to a public module."
403+
)
397404
# sanity check a bit
398405
if mod != "null" and (".png" in fname or "/manual/" in fname):
399406
raise RuntimeError(f"Unexpected {mod} {fname}")
400407
mod_stats[mod][e] += pm
401408
mod_stats["mne"][e] += pm
402409
total_lines += pm
403410
mod_stats.pop("null") # stuff we shouldn't give credit for
411+
# Assert no private (_-prefixed) submodule names remain after null-removal
412+
private_mods = [
413+
m
414+
for m in mod_stats
415+
if m.startswith("mne.") and m.split(".")[-1].startswith("_")
416+
]
417+
if private_mods:
418+
raise RuntimeError(
419+
f"Private submodule(s) {private_mods} found in credit page. "
420+
"Update credit_tools.py to remap them to a public module."
421+
)
404422
mod_stats = dict(
405423
(k, mod_stats[k])
406424
for k in sorted(

doc/sphinxext/related_software.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# cross-domain-saliency-maps requirements are onerous (torch and tensorflow)
2-
# so we don't add it here, and install it separately in circleci_dependencies.sh
1+
# related software with onerous dependencies (e.g., torch and tensorflow)
2+
# should be added to related_software_nodeps.txt
33
alphaCSC
44
autoreject
55
bycycle
@@ -34,6 +34,7 @@ pycrostates
3434
pyprep
3535
pyriemann
3636
python-picard
37+
rsatoolbox
3738
sesameeg
3839
sleepecg
3940
tensorpac

0 commit comments

Comments
 (0)