Skip to content

Commit

Permalink
Merge branch 'main' into correct_annot_export
Browse files Browse the repository at this point in the history
  • Loading branch information
qian-chu authored Jan 20, 2025
2 parents c823f99 + 4f53a37 commit f2381db
Show file tree
Hide file tree
Showing 139 changed files with 1,829 additions and 591 deletions.
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ jobs:
- restore_cache:
keys:
- data-cache-phantom-kit
- restore_cache:
keys:
- data-cache-ds004388
- run:
name: Get data
# This limit could be increased, but this is helpful for finding slow ones
Expand Down Expand Up @@ -252,7 +255,7 @@ jobs:
name: Check sphinx log for warnings (which are treated as errors)
when: always
command: |
! grep "^.* (WARNING|ERROR): .*$" sphinx_log.txt
! grep "^.*\(WARNING\|ERROR\): " sphinx_log.txt
- run:
name: Show profiling output
when: always
Expand Down Expand Up @@ -393,6 +396,10 @@ jobs:
key: data-cache-phantom-kit
paths:
- ~/mne_data/MNE-phantom-KIT-data # (1 G)
- save_cache:
key: data-cache-ds004388
paths:
- ~/mne_data/ds004388 # (1.8 G)


linkcheck:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
name: ruff lint mne
Expand Down Expand Up @@ -82,7 +82,7 @@ repos:

# zizmor
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.0.0
rev: v1.1.1
hooks:
- id: zizmor

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ stages:
- bash: |
set -e
python -m pip install --progress-bar off --upgrade pip
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" pandas neo pymatreader antio defusedxml
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
python -m pip uninstall -yq mne
python -m pip install --progress-bar off --upgrade -e .[test]
displayName: 'Install dependencies with pip'
Expand Down Expand Up @@ -243,7 +243,7 @@ stages:
PYTHONIOENCODING: 'utf-8'
AZURE_CI_WINDOWS: 'true'
PYTHON_ARCH: 'x64'
timeoutInMinutes: 75
timeoutInMinutes: 80
strategy:
maxParallel: 4
matrix:
Expand Down
1 change: 1 addition & 0 deletions doc/api/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Datasets
brainstorm.bst_auditory.data_path
brainstorm.bst_resting.data_path
brainstorm.bst_raw.data_path
default_path
eegbci.load_data
eegbci.standardize
fetch_aparc_sub_parcellation
Expand Down
1 change: 1 addition & 0 deletions doc/api/preprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Projections:
read_ica_eeglab
read_fine_calibration
write_fine_calibration
apply_pca_obs

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

Expand Down
2 changes: 2 additions & 0 deletions doc/api/time_frequency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Functions that operate on mne-python objects:
.. autosummary::
:toctree: ../generated/

combine_spectrum
combine_tfr
csd_tfr
csd_fourier
csd_multitaper
Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel/12910.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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 change: 1 addition & 0 deletions doc/changes/devel/13037.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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`.
1 change: 1 addition & 0 deletions doc/changes/devel/13054.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added :func:`mne.time_frequency.combine_tfr` to allow combining TFRs across tapers, by `Thomas Binns`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13056.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with saving of anonymized data when helium info is present in measurement info, by `Eric Larson`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13058.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13062.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix computation of time intervals in :func:`mne.preprocessing.compute_fine_calibration` by `Eric Larson`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13063.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in the colorbars created by :func:`mne.viz.plot_evoked_topomap` by `Santeri Ruuskanen`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13067.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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`_.
1 change: 1 addition & 0 deletions doc/changes/devel/13069.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug cause by unnecessary assertion when loading mixed frequency EDFs without preloading :func:`mne.io.read_raw_edf` by `Simon Kern`_.
2 changes: 2 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
.. _Eberhard Eich: https://github.com/ebeich
.. _Eduard Ort: https://github.com/eort
.. _Emily Stephen: https://github.com/emilyps14
.. _Emma Bailey: https://www.cbs.mpg.de/employees/bailey
.. _Enrico Varano: https://github.com/enricovara/
.. _Enzo Altamiranda: https://www.linkedin.com/in/enzoalt
.. _Eric Larson: https://larsoner.com
Expand Down Expand Up @@ -284,6 +285,7 @@
.. _Stanislas Chambon: https://github.com/Slasnista
.. _Stefan Appelhoff: https://stefanappelhoff.com
.. _Stefan Repplinger: https://github.com/stfnrpplngr
.. _Steinn Hauser Magnusson: https://github.com/steinnhauser
.. _Steven Bethard: https://github.com/bethard
.. _Steven Bierer: https://github.com/neurolaunch
.. _Steven Gutstein: https://github.com/smgutstein
Expand Down
3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@
"n_frequencies",
"n_tests",
"n_samples",
"n_peaks",
"n_permutations",
"nchan",
"n_points",
Expand Down Expand Up @@ -1289,7 +1290,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
rst_prolog += f"""
.. |{icon}| raw:: html
<i class="{' '.join(classes + (f'fa-{icon}',))}"></i>
<i class="{" ".join(classes + (f"fa-{icon}",))}"></i>
"""

rst_prolog += """
Expand Down
10 changes: 10 additions & 0 deletions doc/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,16 @@ @inproceedings{NdiayeEtAl2016
year = {2016}
}

@article{NiazyEtAl2005,
author = {Niazy, R. K. and Beckmann, C.F. and Iannetti, G.D. and Brady, J. M. and Smith, S. M.},
title = {Removal of FMRI environment artifacts from EEG data using optimal basis sets},
journal = {NeuroImage},
year = {2005},
volume = {28},
pages = {720-737},
doi = {10.1016/j.neuroimage.2005.06.067.}
}

@article{NicholsHolmes2002,
author = {Nichols, Thomas E. and Holmes, Andrew P.},
doi = {10.1002/hbm.1058},
Expand Down
8 changes: 4 additions & 4 deletions doc/sphinxext/credit_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def generate_credit_rst(app=None, *, verbose=False):
if author["e"] is not None:
if author["e"] not in name_map:
unknown_emails.add(
f'{author["e"].ljust(29)} '
f"{author['e'].ljust(29)} "
"https://github.com/mne-tools/mne-python/pull/"
f"{commit}/files"
)
Expand All @@ -178,9 +178,9 @@ def generate_credit_rst(app=None, *, verbose=False):
else:
name = author["n"]
if name in manual_renames:
assert _good_name(
manual_renames[name]
), f"Bad manual rename: {name}"
assert _good_name(manual_renames[name]), (
f"Bad manual rename: {name}"
)
name = manual_renames[name]
if " " in name:
first, last = name.rsplit(" ", maxsplit=1)
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinxext/related_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ def _get_packages() -> dict[str, str]:
assert not dups, f"Duplicates in MANUAL_PACKAGES and PYPI_PACKAGES: {sorted(dups)}"
# And the installer and PyPI-only should be disjoint:
dups = set(PYPI_PACKAGES) & set(packages)
assert (
not dups
), f"Duplicates in PYPI_PACKAGES and installer packages: {sorted(dups)}"
assert not dups, (
f"Duplicates in PYPI_PACKAGES and installer packages: {sorted(dups)}"
)
for name in PYPI_PACKAGES | set(MANUAL_PACKAGES):
if name not in packages:
packages.append(name)
Expand Down
3 changes: 1 addition & 2 deletions doc/sphinxext/unit_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def unit_role(name, rawtext, text, lineno, inliner, options={}, content=[]): #

def pass_error_to_sphinx(rawtext, text, lineno, inliner):
msg = inliner.reporter.error(
"The :unit: role requires a space-separated number and unit; "
f"got {text}",
f"The :unit: role requires a space-separated number and unit; got {text}",
line=lineno,
)
prb = inliner.problematic(rawtext, rawtext, msg)
Expand Down
2 changes: 1 addition & 1 deletion examples/inverse/vector_mne_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
# inverse was computed with loose=0.2
print(
"Absolute cosine similarity between source normals and directions: "
f'{np.abs(np.sum(directions * inv["source_nn"][2::3], axis=-1)).mean()}'
f"{np.abs(np.sum(directions * inv['source_nn'][2::3], axis=-1)).mean()}"
)
brain_max = stc_max.plot(
initial_time=peak_time,
Expand Down
Loading

0 comments on commit f2381db

Please sign in to comment.