diff --git a/.github/workflows/credit.yml b/.github/workflows/credit.yml index d31ddeb7abd..013e27e7214 100644 --- a/.github/workflows/credit.yml +++ b/.github/workflows/credit.yml @@ -37,10 +37,10 @@ jobs: set -xeo pipefail git config --global user.email "50266005+mne-bot@users.noreply.github.com" git config --global user.name "mne[bot]" - BRANCH=credit/$GITHUB_RUN_ID + BRANCH=credit/$(date '+%Y%m%d') git checkout -b $BRANCH git commit -am "mne[bot]: Update code credit" git push origin $BRANCH - PR_NUM=$(gh pr create --base main --head $BRANCH --title "MAINT: Update code credit" --body "Created by credit [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}).

*Adjustments may need to be made to \`doc/changes/credit_tools.py\` or \`.mailmap\` etc. to get CircleCI to pass.*" --label "no-changelog-entry-needed") + PR_NUM=$(gh pr create --base main --head $BRANCH --title "MAINT: Update code credit" --body "Created by credit [GitHub action](https://github.com/mne-tools/mne-python/actions/runs/${{ github.run_id }}).

*Adjustments may need to be made to \`doc/sphinxext/credit_tools.py\` or \`.mailmap\` etc. to get CircleCI to pass.*" --label "no-changelog-entry-needed") echo "Opened https://github.com/mne-tools/mne-python/pull/${PR_NUM}" >> $GITHUB_STEP_SUMMARY if: steps.status.outputs.dirty == 'true' diff --git a/.mailmap b/.mailmap index f5bb38fe0b4..0f7caad8b04 100644 --- a/.mailmap +++ b/.mailmap @@ -20,6 +20,7 @@ Andrew Dykstra Andrew Quinn AJQuinn Andy Gilbert <7andy121@gmail.com> Andrew Gilbert Andy Gilbert <7andy121@gmail.com> Andrew Gilbert +Aniket Singh Yadav <148300120+Aniketsy@users.noreply.github.com> Aniket <148300120+Aniketsy@users.noreply.github.com> Anna Padee apadee <44297909+apadee@users.noreply.github.com> Anne-Sophie Dubarry annesodub Archit Singhal <43236121+architsinghal-mriirs@users.noreply.github.com> archit singhal diff --git a/doc/_includes/institutional-partners.rst b/doc/_includes/institutional-partners.rst index 89586058cf0..3316670b7b6 100644 --- a/doc/_includes/institutional-partners.rst +++ b/doc/_includes/institutional-partners.rst @@ -14,31 +14,31 @@ Current partners ~~~~~~~~~~~~~~~~ - `Aalto-yliopiston perustieteiden korkeakoulu `_ -- `AE Studio `_ -- `Athinoula A. Martinos Center for Biomedical Imaging `_ -- `Children’s Hospital of Philadelphia Research Institute `_ - `Donders Institute for Brain, Cognition and Behaviour at Radboud University `_ -- `Harvard Medical School `_ -- `Institut national de recherche en informatique et en automatique `_ - `Karl-Franzens-Universität Graz `_ -- `Massachusetts General Hospital `_ -- `Max-Planck-Institut für Bildungsforschung `_ -- `SWPS Uniwersytet Humanistycznospołeczny `_ - `University of Washington `_ Former partners ~~~~~~~~~~~~~~~ - `Aarhus Universitet `_ +- `AE Studio `_ +- `Athinoula A. Martinos Center for Biomedical Imaging `_ - `Berkeley Institute for Data Science `_ - `Boston University `_ +- `Children’s Hospital of Philadelphia Research Institute `_ - `Commissariat à l’énergie atomique et aux énergies alternatives `_ - `Fondation Campus Biotech Geneva `_ - `Forschungszentrum Jülich `_ +- `Harvard Medical School `_ - `Institut du Cerveau et de la Moelle épinière `_ - `Institut national de la santé et de la recherche médicale `_ +- `Institut national de recherche en informatique et en automatique `_ +- `Massachusetts General Hospital `_ - `Massachusetts Institute of Technology `_ +- `Max-Planck-Institut für Bildungsforschung `_ - `Macquarie University `_ - `New York University `_ +- `SWPS Uniwersytet Humanistycznospołeczny `_ - `Technische Universität Ilmenau `_ - `Télécom ParisTech `_ diff --git a/doc/changes/dev/13674.other.rst b/doc/changes/dev/13674.other.rst new file mode 100644 index 00000000000..576f70dcf57 --- /dev/null +++ b/doc/changes/dev/13674.other.rst @@ -0,0 +1 @@ +Improve documentation of return values to clarify that methods typically return the original instance type for chaining purposes, by `Aniket Singh Yadav`_. diff --git a/doc/conf.py b/doc/conf.py index 126d8f365a1..0d9fe79346e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -318,13 +318,18 @@ numpydoc_xref_ignore = { # words "and", + "as", "between", + "data", "instance", "instances", + "input", "of", "default", + "same", "shape", "or", + "the", "with", "length", "pair", @@ -987,7 +992,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): klass="only-dark", ), dict( - name="Commissariat à l´énergie atomique et aux énergies alternatives", # noqa E501 + name="Commissariat à l´énergie atomique et aux énergies alternatives", img="CEA.png", url="http://www.cea.fr/", size=md, @@ -1092,7 +1097,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): klass="only-dark", ), dict( - name="Institut national de recherche en informatique et en automatique", # noqa E501 + name="Institut national de recherche en informatique et en automatique", img="inria.png", url="https://www.inria.fr/", size=xl, @@ -1212,7 +1217,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): ), dict( title="Machine Learning", - text="Advanced decoding models including time general\u00adiza\u00adtion.", # noqa E501 + text="Advanced decoding models including time general\u00adiza\u00adtion.", url="auto_tutorials/machine-learning/50_decoding.html", img="sphx_glr_50_decoding_006.png", alt="Decoding", @@ -1226,14 +1231,14 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): ), dict( title="Statistics", - text="Parametric and non-parametric, permutation tests and clustering.", # noqa E501 + text="Parametric and non-parametric, permutation tests and clustering.", url="auto_tutorials/stats-source-space/index.html", img="sphx_glr_20_cluster_1samp_spatiotemporal_001.png", alt="Clusters", ), dict( title="Connectivity", - text="All-to-all spectral and effective connec\u00adtivity measures.", # noqa E501 + text="All-to-all spectral and effective connec\u00adtivity measures.", url="https://mne.tools/mne-connectivity/stable/auto_examples/mne_inverse_label_connectivity.html", # noqa E501 img="https://mne.tools/mne-connectivity/stable/_images/sphx_glr_mne_inverse_label_connectivity_001.png", # noqa E501 alt="Connectivity", diff --git a/doc/sphinxext/credit_tools.py b/doc/sphinxext/credit_tools.py index 8f8b8c00a22..4526a85838f 100644 --- a/doc/sphinxext/credit_tools.py +++ b/doc/sphinxext/credit_tools.py @@ -63,6 +63,7 @@ "akshay0724": "Akshay", # 4046, TODO: Check singleton "alexandra.corneyllie": "Alexandra Corneyllie", # 7600 "alexandra": "Alexandra Corneyllie", # 7600 + "Aniket": "Aniket Singh Yadav", # 13672 "AnneSo": "Anne-Sophie Dubarry", # 4910 "Basile": "Basile Pinsard", # 1791 "Bru": "Bruno Aristimunha", # 13489 diff --git a/doc/sphinxext/prs/13024.json b/doc/sphinxext/prs/13024.json new file mode 100644 index 00000000000..4feede48648 --- /dev/null +++ b/doc/sphinxext/prs/13024.json @@ -0,0 +1,43 @@ +{ + "merge_commit_sha": "a5bf268a1a8645a6b4addc467dec70eb0ec26ce3", + "authors": [ + { + "n": "Victor Férat", + "e": "victor.ferat@live.Fr" + }, + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "Marijn van Vliet", + "e": "w.m.vanvliet@gmail.com" + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/changes/dev/13024.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/bem.py": { + "a": 61, + "d": 29 + }, + "mne/commands/mne_make_scalp_surfaces.py": { + "a": 8, + "d": 0 + }, + "mne/commands/tests/test_commands.py": { + "a": 102, + "d": 24 + }, + "mne/tests/test_bem.py": { + "a": 25, + "d": 3 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13196.json b/doc/sphinxext/prs/13196.json new file mode 100644 index 00000000000..cc4498f8c6a --- /dev/null +++ b/doc/sphinxext/prs/13196.json @@ -0,0 +1,67 @@ +{ + "merge_commit_sha": "437d79be7c5fb855a81d44da30bf9a51c9f60413", + "authors": [ + { + "n": "Konstantinos Tsilimparis", + "e": null + }, + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/api/preprocessing.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/dev/13196.newfeature.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/names.inc": { + "a": 1, + "d": 0 + }, + "examples/preprocessing/interpolate_to.py": { + "a": 71, + "d": 4 + }, + "mne/channels/__init__.pyi": { + "a": 2, + "d": 0 + }, + "mne/channels/channels.py": { + "a": 76, + "d": 133 + }, + "mne/channels/data/canonical_meg/ctf151.csv": { + "a": 152, + "d": 0 + }, + "mne/channels/data/canonical_meg/ctf275.csv": { + "a": 275, + "d": 0 + }, + "mne/channels/data/canonical_meg/neuromag306.csv": { + "a": 307, + "d": 0 + }, + "mne/channels/interpolation.py": { + "a": 138, + "d": 2 + }, + "mne/channels/montage.py": { + "a": 119, + "d": 0 + }, + "mne/channels/tests/test_interpolation.py": { + "a": 25, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13490.json b/doc/sphinxext/prs/13490.json new file mode 100644 index 00000000000..b57031be423 --- /dev/null +++ b/doc/sphinxext/prs/13490.json @@ -0,0 +1,83 @@ +{ + "merge_commit_sha": "4051f3102d39fd2dcc85e0b3079a86c11289816c", + "authors": [ + { + "n": "Daniel McCloy", + "e": null + }, + { + "n": "Carina Forster", + "e": "carinaforster0611@gmail.com" + }, + { + "n": "Thomas S. Binns", + "e": "t.s.binns@outlook.com" + }, + { + "n": "Scott Huberty", + "e": "52462026+scott-huberty@users.noreply.github.com" + }, + { + "n": "Erica Peterson", + "e": "nordme@uw.edu" + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + }, + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + } + ], + "changes": { + ".github/workflows/spec_zero.yml": { + "a": 15, + "d": 7 + }, + ".github/workflows/tests.yml": { + "a": 12, + "d": 3 + }, + "environment.yml": { + "a": 11, + "d": 11 + }, + "pyproject.toml": { + "a": 40, + "d": 30 + }, + "tools/check_pyproject_helpers.py": { + "a": 61, + "d": 0 + }, + "tools/dev/spec_zero_update_versions.py": { + "a": 29, + "d": 22 + }, + "tools/github_actions_check_old.py": { + "a": 0, + "d": 35 + }, + "tools/github_actions_check_old_env.py": { + "a": 68, + "d": 0 + }, + "tools/github_actions_check_old_lockfile.py": { + "a": 68, + "d": 0 + }, + "tools/github_actions_dependencies.sh": { + "a": 28, + "d": 6 + }, + "tools/github_actions_env_vars.sh": { + "a": 5, + "d": 6 + }, + "tools/pylock.ci-old.toml": { + "a": 656, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13544.json b/doc/sphinxext/prs/13544.json new file mode 100644 index 00000000000..418cf3ca062 --- /dev/null +++ b/doc/sphinxext/prs/13544.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "8a11b2e8be48f7844b9b4b907a4a4e8f976b9ab7", + "authors": [ + { + "n": "Teemu Taivainen", + "e": "ttaiv@outlook.com" + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/sphinxext/related_software.py": { + "a": 2, + "d": 1 + }, + "doc/sphinxext/related_software_nodeps.txt": { + "a": 2, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13570.json b/doc/sphinxext/prs/13570.json new file mode 100644 index 00000000000..0dfeb33ff0a --- /dev/null +++ b/doc/sphinxext/prs/13570.json @@ -0,0 +1,35 @@ +{ + "merge_commit_sha": "4a5479d6b496dc18bd325919bc6c346ce7563cfb", + "authors": [ + { + "n": "Aman Srivastava", + "e": null + }, + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "Daniel McCloy", + "e": "dan@mccloy.info" + } + ], + "changes": { + "doc/changes/dev/13570.newfeature.rst": { + "a": 3, + "d": 0 + }, + "doc/changes/names.inc": { + "a": 1, + "d": 0 + }, + "examples/visualization/eeg_on_scalp.py": { + "a": 1, + "d": 0 + }, + "mne/viz/_3d.py": { + "a": 23, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13595.json b/doc/sphinxext/prs/13595.json new file mode 100644 index 00000000000..56c48f814e8 --- /dev/null +++ b/doc/sphinxext/prs/13595.json @@ -0,0 +1,47 @@ +{ + "merge_commit_sha": "8b8edb0a70e2fabb4d6c80a5d72caf63349a4a5e", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "azure-pipelines.yml": { + "a": 2, + "d": 2 + }, + "doc/changes/dev/13595.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/minimum_norm/tests/test_inverse.py": { + "a": 20, + "d": 6 + }, + "mne/tests/test_cov.py": { + "a": 8, + "d": 0 + }, + "mne/viz/evoked.py": { + "a": 6, + "d": 10 + }, + "mne/viz/tests/test_evoked.py": { + "a": 18, + "d": 2 + }, + "mne/viz/utils.py": { + "a": 20, + "d": 14 + }, + "tools/azure_dependencies.sh": { + "a": 1, + "d": 1 + }, + "tools/github_actions_dependencies.sh": { + "a": 0, + "d": 4 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13610.json b/doc/sphinxext/prs/13610.json new file mode 100644 index 00000000000..fa64cbec87d --- /dev/null +++ b/doc/sphinxext/prs/13610.json @@ -0,0 +1,91 @@ +{ + "merge_commit_sha": "ab6346ecf025f6bdd3fbe5c83f92564fdfea9496", + "authors": [ + { + "n": "Bru", + "e": null + }, + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "autofix-ci[bot]", + "e": "114827586+autofix-ci[bot]@users.noreply.github.com" + } + ], + "changes": { + "azure-pipelines.yml": { + "a": 1, + "d": 1 + }, + "doc/_includes/data_formats.rst": { + "a": 3, + "d": 0 + }, + "doc/api/reading_raw_data.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/dev/13610.newfeature.rst": { + "a": 1, + "d": 0 + }, + "doc/conf.py": { + "a": 1, + "d": 0 + }, + "environment.yml": { + "a": 1, + "d": 0 + }, + "mne/datasets/config.py": { + "a": 2, + "d": 2 + }, + "mne/io/__init__.pyi": { + "a": 2, + "d": 0 + }, + "mne/io/_read_raw.py": { + "a": 3, + "d": 0 + }, + "mne/io/mef/__init__.py": { + "a": 7, + "d": 0 + }, + "mne/io/mef/_utils.py": { + "a": 345, + "d": 0 + }, + "mne/io/mef/mef.py": { + "a": 300, + "d": 0 + }, + "mne/io/mef/tests/__init__.py": { + "a": 3, + "d": 0 + }, + "mne/io/mef/tests/test_mef.py": { + "a": 193, + "d": 0 + }, + "mne/tests/test_import_nesting.py": { + "a": 1, + "d": 1 + }, + "mne/utils/config.py": { + "a": 1, + "d": 0 + }, + "pyproject.toml": { + "a": 3, + "d": 0 + }, + "tools/hooks/update_environment_file.py": { + "a": 2, + "d": 2 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13624.json b/doc/sphinxext/prs/13624.json new file mode 100644 index 00000000000..1397a7e61bc --- /dev/null +++ b/doc/sphinxext/prs/13624.json @@ -0,0 +1,167 @@ +{ + "merge_commit_sha": "ee8502bdf9d6fada2b0159dc1dd36ac40175cf1a", + "authors": [ + { + "n": "mne[bot]", + "e": null + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + ".mailmap": { + "a": 3, + "d": 0 + }, + "doc/changes/dev/13520.bugfix.rst": { + "a": 1, + "d": 1 + }, + "doc/changes/dev/13532.other.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/dev/13541.other.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/names.inc": { + "a": 2, + "d": 0 + }, + "doc/sphinxext/credit_tools.py": { + "a": 5, + "d": 1 + }, + "doc/sphinxext/prs/13408.json": { + "a": 59, + "d": 0 + }, + "doc/sphinxext/prs/13520.json": { + "a": 35, + "d": 0 + }, + "doc/sphinxext/prs/13532.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13541.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13551.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13558.json": { + "a": 39, + "d": 0 + }, + "doc/sphinxext/prs/13566.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13572.json": { + "a": 99, + "d": 0 + }, + "doc/sphinxext/prs/13574.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13578.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13579.json": { + "a": 39, + "d": 0 + }, + "doc/sphinxext/prs/13580.json": { + "a": 43, + "d": 0 + }, + "doc/sphinxext/prs/13585.json": { + "a": 191, + "d": 0 + }, + "doc/sphinxext/prs/13586.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13587.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13588.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13590.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13591.json": { + "a": 35, + "d": 0 + }, + "doc/sphinxext/prs/13593.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13594.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13596.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13599.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13600.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13601.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13602.json": { + "a": 19, + "d": 0 + }, + "doc/sphinxext/prs/13606.json": { + "a": 27, + "d": 0 + }, + "doc/sphinxext/prs/13607.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13609.json": { + "a": 15, + "d": 0 + }, + "doc/sphinxext/prs/13611.json": { + "a": 107, + "d": 0 + }, + "doc/sphinxext/prs/13612.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13613.json": { + "a": 23, + "d": 0 + }, + "doc/sphinxext/prs/13620.json": { + "a": 15, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13625.json b/doc/sphinxext/prs/13625.json new file mode 100644 index 00000000000..db0214ca790 --- /dev/null +++ b/doc/sphinxext/prs/13625.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "8b9aeae77567a524aa14fa984e5f0905265277a4", + "authors": [ + { + "n": "mne[bot]", + "e": null + }, + { + "n": "autofix-ci[bot]", + "e": "114827586+autofix-ci[bot]@users.noreply.github.com" + }, + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + ".github/workflows/spec_zero.yml": { + "a": 1, + "d": 1 + }, + "doc/changes/dev/13625.dependency.rst": { + "a": 5, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13626.json b/doc/sphinxext/prs/13626.json new file mode 100644 index 00000000000..ead8fec3b3e --- /dev/null +++ b/doc/sphinxext/prs/13626.json @@ -0,0 +1,15 @@ +{ + "merge_commit_sha": "f3f1c96afb65db1199debc6b4319ee1fcae04cae", + "authors": [ + { + "n": "Daniel McCloy", + "e": null + } + ], + "changes": { + "tools/dev/check_steering_committee.py": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13628.json b/doc/sphinxext/prs/13628.json new file mode 100644 index 00000000000..29bcac35e28 --- /dev/null +++ b/doc/sphinxext/prs/13628.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "1138f8b254907362a69cc8d00830b1c12ba66610", + "authors": [ + { + "n": "Bru", + "e": null + } + ], + "changes": { + "doc/changes/dev/13628.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/io/snirf/_snirf.py": { + "a": 5, + "d": 0 + }, + "mne/io/snirf/tests/test_snirf.py": { + "a": 27, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13629.json b/doc/sphinxext/prs/13629.json new file mode 100644 index 00000000000..284a71fca50 --- /dev/null +++ b/doc/sphinxext/prs/13629.json @@ -0,0 +1,15 @@ +{ + "merge_commit_sha": "e127c0ea125cbfed0eca8b139ad2a33b80919ef7", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/sphinxext/related_software.py": { + "a": 1, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13630.json b/doc/sphinxext/prs/13630.json new file mode 100644 index 00000000000..6779c6e9397 --- /dev/null +++ b/doc/sphinxext/prs/13630.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "454fffa267e110a29e74a9ecb91355c8f5d83632", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/changes/dev/13630.bugfix.rst": { + "a": 1, + "d": 0 + }, + "examples/inverse/dics_epochs.py": { + "a": 4, + "d": 5 + }, + "mne/datasets/_fetch.py": { + "a": 4, + "d": 0 + }, + "mne/datasets/config.py": { + "a": 2, + "d": 2 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13631.json b/doc/sphinxext/prs/13631.json new file mode 100644 index 00000000000..a7af0a005b6 --- /dev/null +++ b/doc/sphinxext/prs/13631.json @@ -0,0 +1,15 @@ +{ + "merge_commit_sha": "b515c2098d2ae983a1fd0af7dd8733df34f7eb79", + "authors": [ + { + "n": "Daniel McCloy", + "e": null + } + ], + "changes": { + "doc/overview/people.rst": { + "a": 25, + "d": 6 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13632.json b/doc/sphinxext/prs/13632.json new file mode 100644 index 00000000000..587b80f3b9a --- /dev/null +++ b/doc/sphinxext/prs/13632.json @@ -0,0 +1,31 @@ +{ + "merge_commit_sha": "e1aa5ed77a22f961a36480c68109f770660d5069", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/changes/names.inc": { + "a": 1, + "d": 1 + }, + "doc/conf.py": { + "a": 1, + "d": 0 + }, + "doc/links.inc": { + "a": 1, + "d": 1 + }, + "doc/sphinxext/mne_doc_utils.py": { + "a": 2, + "d": 0 + }, + "mne/conftest.py": { + "a": 15, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13643.json b/doc/sphinxext/prs/13643.json new file mode 100644 index 00000000000..b206e6818f1 --- /dev/null +++ b/doc/sphinxext/prs/13643.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "cd888c17eaf1bb004550f969fc28ade808225430", + "authors": [ + { + "n": "dependabot[bot]", + "e": "49699333+dependabot[bot]@users.noreply.github.com" + }, + { + "n": "mne[bot]", + "e": "50266005+mne-bot@users.noreply.github.com" + } + ], + "changes": { + ".github/workflows/autofix.yml": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13645.json b/doc/sphinxext/prs/13645.json new file mode 100644 index 00000000000..026d02e7d33 --- /dev/null +++ b/doc/sphinxext/prs/13645.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "87d1051d6932383e825ba377b21a221b2670db11", + "authors": [ + { + "n": "Thomas S. Binns", + "e": "t.s.binns@outlook.com" + } + ], + "changes": { + "doc/changes/dev/13611.dependency.rst": { + "a": 0, + "d": 1 + }, + "doc/changes/dev/13625.dependency.rst": { + "a": 0, + "d": 5 + }, + "tools/dev/spec_zero_update_versions.py": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13646.json b/doc/sphinxext/prs/13646.json new file mode 100644 index 00000000000..917330c0dc1 --- /dev/null +++ b/doc/sphinxext/prs/13646.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "cd9ae4db0bfe7836a640c7f17a473788c5ca8e06", + "authors": [ + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "mne[bot]", + "e": "50266005+mne-bot@users.noreply.github.com" + } + ], + "changes": { + ".pre-commit-config.yaml": { + "a": 1, + "d": 1 + }, + "mne/io/hitachi/hitachi.py": { + "a": 6, + "d": 4 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13647.json b/doc/sphinxext/prs/13647.json new file mode 100644 index 00000000000..80e965fcf40 --- /dev/null +++ b/doc/sphinxext/prs/13647.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "8f75a7da57f8eac5159a8a0201b4a3f847585a99", + "authors": [ + { + "n": "Clemens Brunner", + "e": null + } + ], + "changes": { + "doc/changes/dev/13647.newfeature.rst": { + "a": 1, + "d": 0 + }, + "mne/_fiff/meas_info.py": { + "a": 19, + "d": 5 + }, + "mne/_fiff/tests/test_meas_info.py": { + "a": 45, + "d": 3 + }, + "mne/utils/docs.py": { + "a": 13, + "d": 8 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13649.json b/doc/sphinxext/prs/13649.json new file mode 100644 index 00000000000..e98a7247b1a --- /dev/null +++ b/doc/sphinxext/prs/13649.json @@ -0,0 +1,43 @@ +{ + "merge_commit_sha": "5e389d0a88206810f51f9e064158966a009f28b2", + "authors": [ + { + "n": "Daniel McCloy", + "e": null + } + ], + "changes": { + "doc/changes/dev/13630.bugfix.rst": { + "a": 1, + "d": 0 + }, + "doc/sphinxext/gh_substitutions.py": { + "a": 18, + "d": 2 + }, + "doc/sphinxext/mne_doc_utils.py": { + "a": 12, + "d": 0 + }, + "doc/sphinxext/related_software.txt": { + "a": 1, + "d": 0 + }, + "doc/sphinxext/related_software_nodeps.txt": { + "a": 1, + "d": 0 + }, + "examples/inverse/dics_epochs.py": { + "a": 4, + "d": 5 + }, + "mne/datasets/_fetch.py": { + "a": 4, + "d": 0 + }, + "mne/datasets/config.py": { + "a": 2, + "d": 2 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13652.json b/doc/sphinxext/prs/13652.json new file mode 100644 index 00000000000..388c5eedd08 --- /dev/null +++ b/doc/sphinxext/prs/13652.json @@ -0,0 +1,15 @@ +{ + "merge_commit_sha": "d6e978467ff4545f81876ce383c520d4d832c993", + "authors": [ + { + "n": "Himanshu Mahor", + "e": null + } + ], + "changes": { + "mne/utils/docs.py": { + "a": 3, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13654.json b/doc/sphinxext/prs/13654.json new file mode 100644 index 00000000000..70ddd2f5682 --- /dev/null +++ b/doc/sphinxext/prs/13654.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "70326482061245f1642619e764649e4dda8ead85", + "authors": [ + { + "n": "Clemens Brunner", + "e": null + } + ], + "changes": { + "doc/changes/dev/13654.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/viz/_mpl_figure.py": { + "a": 1, + "d": 1 + }, + "mne/viz/tests/test_epochs.py": { + "a": 4, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13655.json b/doc/sphinxext/prs/13655.json new file mode 100644 index 00000000000..e36a670a57a --- /dev/null +++ b/doc/sphinxext/prs/13655.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "f067dd7ea1a19d1f931a6f8433bf4052376f5349", + "authors": [ + { + "n": "Lumberbot (aka Jack)", + "e": null + }, + { + "n": "Clemens Brunner", + "e": "clemens.brunner@gmail.com" + } + ], + "changes": { + "doc/changes/dev/13654.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/viz/_mpl_figure.py": { + "a": 1, + "d": 1 + }, + "mne/viz/tests/test_epochs.py": { + "a": 4, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13658.json b/doc/sphinxext/prs/13658.json new file mode 100644 index 00000000000..e33cc255c13 --- /dev/null +++ b/doc/sphinxext/prs/13658.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "6589b8672bac9de0d8df31a6ad4afce916b3046c", + "authors": [ + { + "n": "Scott Huberty", + "e": null + } + ], + "changes": { + "doc/_includes/bem_model.rst": { + "a": 1, + "d": 1 + }, + "doc/links.inc": { + "a": 2, + "d": 0 + }, + "mne/bem.py": { + "a": 8, + "d": 1 + }, + "tutorials/forward/50_background_freesurfer_mne.py": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13663.json b/doc/sphinxext/prs/13663.json new file mode 100644 index 00000000000..ff4d1b297ac --- /dev/null +++ b/doc/sphinxext/prs/13663.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "a64cc193bd0d609ed3adbf94ada6245abf07d7e8", + "authors": [ + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "mne[bot]", + "e": "50266005+mne-bot@users.noreply.github.com" + } + ], + "changes": { + ".pre-commit-config.yaml": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13665.json b/doc/sphinxext/prs/13665.json new file mode 100644 index 00000000000..f7478b30125 --- /dev/null +++ b/doc/sphinxext/prs/13665.json @@ -0,0 +1,15 @@ +{ + "merge_commit_sha": "7de840cd5940c879feb1dad1a2e0c4e8ec6efee9", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/sphinxext/related_software.txt": { + "a": 1, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13668.json b/doc/sphinxext/prs/13668.json new file mode 100644 index 00000000000..8f85ad0ba5b --- /dev/null +++ b/doc/sphinxext/prs/13668.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "8dd298f48f27a678ccde2e2bfa6a5f57e274c584", + "authors": [ + { + "n": "Daniel McCloy", + "e": null + } + ], + "changes": { + "doc/_includes/institutional-partners.rst": { + "a": 8, + "d": 8 + }, + "doc/conf.py": { + "a": 5, + "d": 5 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13669.json b/doc/sphinxext/prs/13669.json new file mode 100644 index 00000000000..45cfbcfd398 --- /dev/null +++ b/doc/sphinxext/prs/13669.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "557eca671d50499cd584232334f636f76afe7c07", + "authors": [ + { + "n": "Scott Huberty", + "e": null + } + ], + "changes": { + "doc/changes/dev/13669.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/__init__.pyi": { + "a": 2, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13670.json b/doc/sphinxext/prs/13670.json new file mode 100644 index 00000000000..a0bde4d169a --- /dev/null +++ b/doc/sphinxext/prs/13670.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "b8496fa0b4bd482125822ed4b3baa01dd0042294", + "authors": [ + { + "n": "Lumberbot (aka Jack)", + "e": null + }, + { + "n": "Scott Huberty", + "e": "52462026+scott-huberty@users.noreply.github.com" + } + ], + "changes": { + "doc/changes/dev/13669.bugfix.rst": { + "a": 1, + "d": 0 + }, + "mne/__init__.pyi": { + "a": 2, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13672.json b/doc/sphinxext/prs/13672.json new file mode 100644 index 00000000000..08ed04fcbb6 --- /dev/null +++ b/doc/sphinxext/prs/13672.json @@ -0,0 +1,31 @@ +{ + "merge_commit_sha": "dcc711615a1e56275f17382aa8bea639e6ba8ae5", + "authors": [ + { + "n": "Aniket", + "e": null + }, + { + "n": "Daniel McCloy", + "e": "dan@mccloy.info" + } + ], + "changes": { + "doc/changes/dev/13672.bugfix.rst": { + "a": 1, + "d": 0 + }, + "doc/changes/names.inc": { + "a": 1, + "d": 0 + }, + "mne/io/snirf/_snirf.py": { + "a": 1, + "d": 1 + }, + "mne/io/tests/test_raw.py": { + "a": 7, + "d": 4 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13674.json b/doc/sphinxext/prs/13674.json new file mode 100644 index 00000000000..bf91bac06ae --- /dev/null +++ b/doc/sphinxext/prs/13674.json @@ -0,0 +1,79 @@ +{ + "merge_commit_sha": "e9f9bf68c2a0b9dea20fd440350531aa89d29b33", + "authors": [ + { + "n": "Aniket", + "e": null + }, + { + "n": "Marijn van Vliet", + "e": "w.m.vanvliet@gmail.com" + } + ], + "changes": { + "doc/changes/dev/13674.other.rst": { + "a": 1, + "d": 0 + }, + "doc/conf.py": { + "a": 5, + "d": 0 + }, + "mne/_fiff/meas_info.py": { + "a": 6, + "d": 6 + }, + "mne/_fiff/proj.py": { + "a": 3, + "d": 3 + }, + "mne/_fiff/reference.py": { + "a": 3, + "d": 3 + }, + "mne/channels/channels.py": { + "a": 11, + "d": 11 + }, + "mne/filter.py": { + "a": 3, + "d": 3 + }, + "mne/io/base.py": { + "a": 2, + "d": 2 + }, + "mne/preprocessing/_csd.py": { + "a": 1, + "d": 1 + }, + "mne/preprocessing/_regress.py": { + "a": 1, + "d": 1 + }, + "mne/preprocessing/eyetracking/eyetracking.py": { + "a": 2, + "d": 2 + }, + "mne/preprocessing/ica.py": { + "a": 2, + "d": 2 + }, + "mne/preprocessing/interpolate.py": { + "a": 1, + "d": 1 + }, + "mne/preprocessing/stim.py": { + "a": 1, + "d": 1 + }, + "mne/simulation/evoked.py": { + "a": 1, + "d": 1 + }, + "mne/utils/mixin.py": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13675.json b/doc/sphinxext/prs/13675.json new file mode 100644 index 00000000000..16502845ca3 --- /dev/null +++ b/doc/sphinxext/prs/13675.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "371920011756d14af038db4eb87b00a3e901b5c3", + "authors": [ + { + "n": "Clemens Brunner", + "e": null + } + ], + "changes": { + "doc/changes/dev/13675.other.rst": { + "a": 1, + "d": 0 + }, + "mne/epochs.py": { + "a": 13, + "d": 0 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13677.json b/doc/sphinxext/prs/13677.json new file mode 100644 index 00000000000..7bc06b8bd30 --- /dev/null +++ b/doc/sphinxext/prs/13677.json @@ -0,0 +1,23 @@ +{ + "merge_commit_sha": "6646cba043594cf413e4163f13e1c587adf848e5", + "authors": [ + { + "n": "Eric Larson", + "e": "larson.eric.d@gmail.com" + } + ], + "changes": { + "doc/sphinxext/mne_doc_utils.py": { + "a": 2, + "d": 0 + }, + "examples/inverse/morph_volume_stc.py": { + "a": 0, + "d": 1 + }, + "tutorials/inverse/50_beamformer_lcmv.py": { + "a": 2, + "d": 2 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13678.json b/doc/sphinxext/prs/13678.json new file mode 100644 index 00000000000..e07184afb7f --- /dev/null +++ b/doc/sphinxext/prs/13678.json @@ -0,0 +1,19 @@ +{ + "merge_commit_sha": "c089d8560de394be180b7a7b591cfd581b3d4532", + "authors": [ + { + "n": "pre-commit-ci[bot]", + "e": "66853113+pre-commit-ci[bot]@users.noreply.github.com" + }, + { + "n": "mne[bot]", + "e": "50266005+mne-bot@users.noreply.github.com" + } + ], + "changes": { + ".pre-commit-config.yaml": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/doc/sphinxext/prs/13690.json b/doc/sphinxext/prs/13690.json new file mode 100644 index 00000000000..9089f4c0b59 --- /dev/null +++ b/doc/sphinxext/prs/13690.json @@ -0,0 +1,27 @@ +{ + "merge_commit_sha": "ce94c0577b4ec0ee50bee00dddf82f062deb1bb3", + "authors": [ + { + "n": "Thomas S. Binns", + "e": "t.s.binns@outlook.com" + } + ], + "changes": { + "examples/datasets/limo_data.py": { + "a": 1, + "d": 1 + }, + "mne/io/edf/edf.py": { + "a": 6, + "d": 6 + }, + "tutorials/evoked/30_eeg_erp.py": { + "a": 1, + "d": 1 + }, + "tutorials/intro/70_report.py": { + "a": 1, + "d": 1 + } + } +} \ No newline at end of file diff --git a/examples/forward/deface_dig_and_mri.py b/examples/forward/deface_dig_and_mri.py new file mode 100644 index 00000000000..e7445111ba5 --- /dev/null +++ b/examples/forward/deface_dig_and_mri.py @@ -0,0 +1,176 @@ +""" +.. _deface-dig-and-mri: + +================================================ +Deface MRI and MEG data for identity protection +================================================ + +Because facial information can be identifying, it is sometimes necessary to +obscure facial detail in MEG and MRI data. This example shows how to do deface +MRI and MEG data without altering head volume or coregistration. + +To learn more about coordinate frames, see :ref:`tut-source-alignment`. +""" + +# Authors: The MNE-Python contributors. +# License: BSD-3-Clause +# Copyright the MNE-Python contributors. + +import nibabel as nib +import numpy as np +from pyvista import Plotter, PolyData +from scipy import linalg +from scipy.spatial.distance import cdist + +import mne +from mne.io.constants import FIFF + +data_path = mne.datasets.sample.data_path() +subjects_dir = data_path / "subjects" +raw_fname = data_path / "MEG" / "sample" / "sample_audvis_raw.fif" +trans_fname = data_path / "MEG" / "sample" / "sample_audvis_raw-trans.fif" +raw = mne.io.read_raw_fif(raw_fname) +trans = mne.read_trans(trans_fname) +src = mne.read_source_spaces(subjects_dir / "sample" / "bem" / "sample-oct-6-src.fif") + +# Load the T1 file and change the header information to the correct units +t1w = nib.load(data_path / "subjects" / "sample" / "mri" / "T1.mgz") +t1w = nib.Nifti1Image(t1w.dataobj, t1w.affine) +t1w.header["xyzt_units"] = np.array(10, dtype="uint8") +t1_mgh = nib.MGHImage(t1w.dataobj, t1w.affine) + + +def apply_smoothing(points, tris): + surf = PolyData.from_regular_faces(points, tris) + surf.clean() + # taubin smoothing conserves volume and triangle face relationships + smooth_surf = surf.smooth_taubin(n_iter=1000, pass_band=0.0005) + out_points = smooth_surf.points + return out_points + + +def smooth_digitization(dig_p, orig_scalp, smooth_scalp): + out_dig = dig_p.copy() + all_dists = cdist(dig_p, orig_scalp) + closest_point_idxs = all_dists.argmin(axis=1) + diffs = orig_scalp[closest_point_idxs, :] - smooth_scalp[closest_point_idxs, :] + for ppi, pp in enumerate(dig_p): + out_dig[ppi] = pp - diffs[ppi] + return out_dig + + +def add_head(renderer, points, tris, color, opacity=0.95): + renderer.mesh(*points.T, triangles=tris, color=color, opacity=opacity) + + +# Smooth MRI +# The head surface is stored in "mri" coordinate frame +# (origin at center of volume, units=mm) +seghead_rr, seghead_tri = mne.read_surface( + subjects_dir / "sample" / "surf" / "lh.seghead" +) + +# The "mri_voxel"→"mri" transform is embedded in the header of the T1 image +# file. We'll invert it and then apply it to the original `seghead_rr` points. +# No unit conversion necessary: this transform expects mm and the scalp surface +# is defined in mm. +vox_to_mri = t1_mgh.header.get_vox2ras_tkr() +mri_to_vox = linalg.inv(vox_to_mri) +scalp_points_in_vox = mne.transforms.apply_trans(mri_to_vox, seghead_rr, move=True) + + +# Get fiducial points and extras: +# "r" selects just the XYZ values +fids = [p["r"] for p in raw.info["dig"] if p["kind"] == FIFF.FIFFV_POINT_CARDINAL] +assert raw.info["dig"][0]["coord_frame"] == FIFF.FIFFV_COORD_HEAD +extra = [e["r"] for e in raw.info["dig"] if e["kind"] == FIFF.FIFFV_POINT_EXTRA] + +dig_points = fids + extra +for dpi, dp in enumerate(dig_points): + # Transform it from head to MRI space (recall that `trans` is head → mri) + trans_dp = mne.transforms.apply_trans(trans, dp, move=True) + # Then transform to voxel space, after converting from meters to millimeters + dig_points[dpi] = mne.transforms.apply_trans(mri_to_vox, trans_dp * 1e3, move=True) + +dig_points = np.array(dig_points) + +# smooth the whole head + +smooth_scalp_points = apply_smoothing(scalp_points_in_vox, seghead_tri) + +# The voxel frame origin is located at the top right corner behind the +# subject's head with coordinates in the following order: +# right-to-left axis, superior-to-inferior axis, posterior-to-anterior axis. +# choose facial points from smooth head + +fid_y = np.mean([dig_points[0, 2], dig_points[2, 2]]) +nasion_z = dig_points[1, 1] + +ahead_of_ears = scalp_points_in_vox[:, 2] > fid_y + 10 +under_eyebrows = scalp_points_in_vox[:, 1] > nasion_z - 15 +idxs_to_smooth = np.where(ahead_of_ears & under_eyebrows)[0] + +tris_to_smooth = np.isin(seghead_tri, idxs_to_smooth).all(axis=1) + +# choose dig to smooth +dig_ahead_of_ears = dig_points[:, 2] > fid_y + 10 +dig_under_brows = dig_points[:, 1] > nasion_z - 15 +dig_to_smooth = np.where(dig_ahead_of_ears & dig_under_brows)[0] + +smooth_dig = smooth_digitization( + dig_points[dig_to_smooth], scalp_points_in_vox, smooth_scalp_points +) + +# preview point selection from face and facial dig +preview = Plotter() + +preview.add_mesh( + smooth_dig, + color="red", + render_points_as_spheres=True, + point_size=8, +) + +preview.add_mesh( + smooth_scalp_points[idxs_to_smooth, :], + color="blue", + render_points_as_spheres=True, + point_size=2, +) +preview.show() +preview.close() + +# Plot smoothed results to make sure the transforms worked +renderer = mne.viz.backends.renderer.create_3d_figure( + size=(400, 400), bgcolor="w", scene=False +) + +original_head_surf = scalp_points_in_vox.copy() + +defaced_surf = scalp_points_in_vox.copy() +defaced_surf[idxs_to_smooth, :] = smooth_scalp_points[idxs_to_smooth, :] + +defaced_dig = dig_points.copy() +defaced_dig[dig_to_smooth] = smooth_dig + +# plot original head surface in grey +add_head(renderer, original_head_surf, seghead_tri, "grey", opacity=0.3) + +add_head(renderer, defaced_surf, seghead_tri, "green", opacity=0.5) + +# plot fiducials +renderer.sphere(center=defaced_dig[0], color="orange", scale=10) +renderer.sphere(center=defaced_dig[1], color="orange", scale=10) +renderer.sphere(center=defaced_dig[2], color="orange", scale=10) +# plot dig points +for sd in defaced_dig[3:]: + renderer.sphere(center=sd, color="red", scale=3) +# show the plot +mne.viz.set_3d_view( + figure=renderer.figure, + distance=600.0, + focalpoint=(0.0, 125.0, 250.0), + elevation=45, + azimuth=180, +) +renderer.show() diff --git a/mne/_fiff/meas_info.py b/mne/_fiff/meas_info.py index 92a4cf58531..fbb602caf2f 100644 --- a/mne/_fiff/meas_info.py +++ b/mne/_fiff/meas_info.py @@ -397,7 +397,7 @@ def set_montage( Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The instance, modified in-place. See Also @@ -539,7 +539,7 @@ def set_channel_types(self, mapping, *, on_unit_change="warn", verbose=None): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The instance (modified in place). .. versionchanged:: 0.20 @@ -642,7 +642,7 @@ def rename_channels( Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The instance (modified in place). .. versionchanged:: 0.20 @@ -787,7 +787,7 @@ def anonymize(self, daysback=None, keep_his=False, verbose=None): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The modified instance. Notes @@ -816,8 +816,8 @@ def set_meas_date(self, meas_date): Returns ------- - inst : instance of Raw | Epochs | Evoked - The modified raw instance. Operates in place. + inst : same type as the input data + The modified instance. Operates in place. See Also -------- diff --git a/mne/_fiff/proj.py b/mne/_fiff/proj.py index aa010085904..65125c45d3d 100644 --- a/mne/_fiff/proj.py +++ b/mne/_fiff/proj.py @@ -243,7 +243,7 @@ def add_proj(self, projs, remove_existing=False, verbose=None): Returns ------- - self : instance of Raw | Epochs | Evoked + self : same type as the input data The data container. """ if isinstance(projs, Projection): @@ -283,7 +283,7 @@ def apply_proj(self, verbose=None): Returns ------- - self : instance of Raw | Epochs | Evoked + self : same type as the input data The instance. Notes @@ -362,7 +362,7 @@ def del_proj(self, idx="all"): Returns ------- - self : instance of Raw | Epochs | Evoked + self : same type as the input data The instance. """ if isinstance(idx, str) and idx == "all": diff --git a/mne/_fiff/reference.py b/mne/_fiff/reference.py index 13fed0eebd2..3b654ee7784 100644 --- a/mne/_fiff/reference.py +++ b/mne/_fiff/reference.py @@ -228,7 +228,7 @@ def add_reference_channels(inst, ref_channels, copy=True): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data Data with added EEG reference channels. Notes @@ -396,7 +396,7 @@ def set_eeg_reference( Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data Data with EEG channels re-referenced. If ``ref_channels="average"`` and ``projection=True`` a projection will be added instead of directly re-referencing the data. @@ -575,7 +575,7 @@ def set_bipolar_reference( Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data Data with the specified channels re-referenced. See Also diff --git a/mne/channels/channels.py b/mne/channels/channels.py index d337353c49c..ab54bf200dd 100644 --- a/mne/channels/channels.py +++ b/mne/channels/channels.py @@ -325,7 +325,7 @@ def set_eeg_reference( Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data Data with EEG channels re-referenced. If ``ref_channels='average'`` and ``projection=True`` a projection will be added instead of directly re-referencing the data. @@ -388,7 +388,7 @@ def pick_types( Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. See Also @@ -463,7 +463,7 @@ def pick_channels(self, ch_names, ordered=True, *, verbose=None): Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. See Also @@ -501,7 +501,7 @@ def pick(self, picks, exclude=(), *, verbose=None): Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. """ picks = _picks_to_idx(self.info, picks, "all", exclude, allow_empty=False) @@ -532,7 +532,7 @@ def reorder_channels(self, ch_names): Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. See Also @@ -569,7 +569,7 @@ def drop_channels(self, ch_names, on_missing="raise"): Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. See Also @@ -691,7 +691,7 @@ def add_channels(self, add_list, force_update_info=False): Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. See Also @@ -812,7 +812,7 @@ def add_reference_channels(self, ref_channels): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The modified instance. """ return add_reference_channels(self, ref_channels, copy=False) @@ -878,7 +878,7 @@ def interpolate_bads( Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data The modified instance. Notes @@ -1006,7 +1006,7 @@ def interpolate_to( Returns ------- - inst : instance of Raw, Epochs, or Evoked + inst : same type as the input data A new instance with interpolated data and updated channel information. @@ -2015,7 +2015,7 @@ def combine_channels( Returns ------- - combined_inst : instance of Raw, Epochs, or Evoked + combined_inst : same type as the input data An MNE-Python object of the same type as the input ``inst``, containing one virtual channel for each group in ``groups`` (and, if ``keep_stim`` is ``True``, also containing stimulus channels). diff --git a/mne/filter.py b/mne/filter.py index 304afdf4de7..f8f4abf6499 100644 --- a/mne/filter.py +++ b/mne/filter.py @@ -2387,7 +2387,7 @@ def savgol_filter(self, h_freq, verbose=None): Returns ------- - inst : instance of Epochs, Evoked or SourceEstimate + inst : same type as the input data The object with the filtering applied. See Also @@ -2480,7 +2480,7 @@ def filter( Returns ------- - inst : instance of Epochs, Evoked, SourceEstimate, or Raw + inst : same type as the input data The filtered data. See Also @@ -2616,7 +2616,7 @@ def resample( Returns ------- - inst : instance of Epochs or Evoked + inst : same type as the input data The resampled object. See Also diff --git a/mne/io/base.py b/mne/io/base.py index e2cc3e3c757..ec5ce7594e4 100644 --- a/mne/io/base.py +++ b/mne/io/base.py @@ -2185,11 +2185,11 @@ def close(self): pass # noqa def copy(self): - """Return copy of Raw instance. + """Return copy of the instance. Returns ------- - inst : instance of Raw + inst : same type as the input data A copy of the instance. """ return deepcopy(self) diff --git a/mne/preprocessing/_csd.py b/mne/preprocessing/_csd.py index 35a32e90245..b2c9bf1fa8b 100644 --- a/mne/preprocessing/_csd.py +++ b/mne/preprocessing/_csd.py @@ -90,7 +90,7 @@ def compute_current_source_density( Returns ------- - inst_csd : instance of Raw, Epochs or Evoked + inst_csd : same type as the input data The transformed data. Output type will match input type. Notes diff --git a/mne/preprocessing/_regress.py b/mne/preprocessing/_regress.py index d7d54c637d6..6c866b6e421 100644 --- a/mne/preprocessing/_regress.py +++ b/mne/preprocessing/_regress.py @@ -63,7 +63,7 @@ def regress_artifact( Returns ------- - inst : instance of Epochs | Raw + inst : same type as the input data The processed data. betas : ndarray, shape (n_picks, n_picks_ref) The betas used during regression. diff --git a/mne/preprocessing/eyetracking/eyetracking.py b/mne/preprocessing/eyetracking/eyetracking.py index 5c95b5c4d78..afdf0d6c033 100644 --- a/mne/preprocessing/eyetracking/eyetracking.py +++ b/mne/preprocessing/eyetracking/eyetracking.py @@ -40,7 +40,7 @@ def set_channel_types_eyetrack(inst, mapping): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The instance, modified in place. Notes @@ -179,7 +179,7 @@ def convert_units(inst, calibration, to="radians"): Returns ------- - inst : instance of Raw | Epochs | Evoked + inst : same type as the input data The Raw, Epochs, or Evoked instance, modified in place. Notes diff --git a/mne/preprocessing/ica.py b/mne/preprocessing/ica.py index 9b98ef9b2d4..38ce20a4318 100644 --- a/mne/preprocessing/ica.py +++ b/mne/preprocessing/ica.py @@ -1247,7 +1247,7 @@ def get_sources(self, inst, add_channels=None, start=None, stop=None): Returns ------- - sources : instance of Raw, Epochs or Evoked + sources : same type as the input data The ICA sources time series. """ if isinstance(inst, BaseRaw): @@ -2221,7 +2221,7 @@ def apply( Returns ------- - out : instance of Raw, Epochs or Evoked + out : same type as the input data The processed data. Notes diff --git a/mne/preprocessing/interpolate.py b/mne/preprocessing/interpolate.py index e0152bbf2dc..e934e158fab 100644 --- a/mne/preprocessing/interpolate.py +++ b/mne/preprocessing/interpolate.py @@ -101,7 +101,7 @@ def interpolate_bridged_electrodes(inst, bridged_idx, bad_limit=4): Returns ------- - inst : instance of Epochs, Evoked, or Raw + inst : same type as the input data The modified data object. See Also diff --git a/mne/preprocessing/stim.py b/mne/preprocessing/stim.py index a823820988b..ca8e15cf64e 100644 --- a/mne/preprocessing/stim.py +++ b/mne/preprocessing/stim.py @@ -94,7 +94,7 @@ def fix_stim_artifact( Returns ------- - inst : instance of Raw or Evoked or Epochs + inst : same type as the input data Instance with modified data. """ _check_option("mode", mode, ["linear", "window", "constant"]) diff --git a/mne/simulation/evoked.py b/mne/simulation/evoked.py index 2b225727dfe..9805e520496 100644 --- a/mne/simulation/evoked.py +++ b/mne/simulation/evoked.py @@ -117,7 +117,7 @@ def add_noise(inst, cov, iir_filter=None, random_state=None, verbose=None): Returns ------- - inst : instance of Evoked, Epochs, or Raw + inst : same type as the input data The instance, modified to have additional noise. Notes diff --git a/mne/utils/mixin.py b/mne/utils/mixin.py index 741636115e2..f0d4b9f7524 100644 --- a/mne/utils/mixin.py +++ b/mne/utils/mixin.py @@ -603,7 +603,7 @@ def crop(self, tmin=None, tmax=None, include_tmax=True, verbose=None): Returns ------- - inst : instance of Raw, Epochs, Evoked, AverageTFR, or SourceEstimate + inst : same type as the input data The cropped time-series object, modified in-place. Notes