Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into kernel
Browse files Browse the repository at this point in the history
* upstream/main: (37 commits)
  Use constrained layout in matplotlib visualization (mne-tools#12050)
  Add raw stc (mne-tools#12001)
  [MRG] update codeowners (mne-tools#12089)
  DOC: Morlet wavelet length in tfr_morlet (mne-tools#12073)
  BUG: Fix bug with mne browser backend (mne-tools#12078)
  Cache avatars (mne-tools#12077)
  BUG: Fix bug with ch_name resolution (mne-tools#12086)
  add unicode roundtrip for FIF (mne-tools#12080)
  add Ivan to names.inc (mne-tools#12081)
  MAINT: Work around PySide 6.5.3 event loop error (mne-tools#12076)
  mne-tools#11608, buggfix and docstring update (mne-tools#12066)
  MAINT: Fix broken examples (mne-tools#12074)
  Add UI Event linking to DraggableColorbar (mne-tools#12057)
  handle lazy loading through .pyi type stubs (mne-tools#12072)
  BUG: Fix bug with sensor_colors (mne-tools#12068)
  clean  up some deprecations (mne-tools#12067)
  Allow not dropping bads when creating or plotting Spectrum objs (mne-tools#12006)
  Collapsible html repr for raw/info (mne-tools#12064)
  BUG: Fix bug with pickling MNEBadsList (mne-tools#12063)
  add details for Denis (mne-tools#12065)
  ...
  • Loading branch information
larsoner committed Oct 10, 2023
2 parents 5ffedd8 + fdaeb86 commit f952d58
Show file tree
Hide file tree
Showing 262 changed files with 3,850 additions and 3,997 deletions.
44 changes: 25 additions & 19 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#################################################

# Artifact regression
/mne/preprocessing/_regress.py @wmvanvliet @cbrnr
/mne/preprocessing/_regress.py @wmvanvliet
/mne/preprocessing/tests/test_regress.py @wmvanvliet

# Beamforming
Expand All @@ -33,25 +33,26 @@
*lcmv*.py @britta-wstnr

# Channels
/mne/channels @cbrnr @agramfort @mscheltienne
/mne/channels @agramfort @mscheltienne @dengemann @jasmainak

# Core sensor-space classes
/mne/epochs.py @drammock @agramfort @mscheltienne
/mne/evoked.py @drammock @agramfort @mscheltienne
/mne/io/*.* @drammock @cbrnr @agramfort @mscheltienne
/mne/epochs.py @drammock @agramfort @mscheltienne @dengemann
/mne/evoked.py @drammock @agramfort @mscheltienne @dengemann
/mne/io/*.* @drammock @cbrnr @agramfort @mscheltienne @dengemann

# Current-source density
/mne/preprocessing/_csd.py @alexrockhill
/mne/preprocessing/_csd.py @alexrockhill @dengemann

# Decoding
/mne/decoding/csp.py @cbrnr @agramfort
/mne/decoding/csp.py @cbrnr @agramfort @dengemann
/mne/decoding/*.py @jasmainak

# fNIRS
/mne/preprocessing/nirs @rob-luke
*fnirs*.py @rob-luke

# forward
/mne/forward/ @agramfort
/mne/forward/ @agramfort @jasmainak
*forward*.py @agramfort

# Intracranial
Expand All @@ -69,19 +70,21 @@
/mne/io/nirx @rob-luke
/mne/io/snirf @rob-luke
/mne/export @sappelhoff @cbrnr
/mne/io/eeglab.py @jasmainak
/mne/io/eeglab/tests/test_eeglab.py @jasmainak

# Minimum Norm
/mne/minimum_norm @agramfort

# Preprocessing
/mne/preprocessing/ica.py @cbrnr @adam2392 @agramfort @mscheltienne
/mne/preprocessing/infomax_.py @cbrnr @adam2392 @mscheltienne
/mne/preprocessing/ica.py @cbrnr @adam2392 @agramfort @mscheltienne @dengemann
/mne/preprocessing/infomax_.py @cbrnr @adam2392 @mscheltienne @dengemann
/mne/preprocessing/*annotate*.py @mscheltienne
/mne/preprocessing/bads.py @mscheltienne
/mne/preprocessing/e*g.py @mscheltienne

# Report
/mne/report @hoechenberger
/mne/report @hoechenberger @dengemann @jasmainak

# Simulation
/mne/simulation/ @agramfort
Expand All @@ -93,25 +96,28 @@
/mne/_freesurfer.py @alexrockhill @larsoner

# TFR
/mne/time_frequency @drammock @cbrnr @adam2392 @mscheltienne
/mne/time_frequency @drammock @adam2392 @mscheltienne

# Viz
/mne/viz @drammock @cbrnr
/mne/viz @drammock @dengemann
/mne/viz/_brain @larsoner @wmvanvliet
/mne/viz/ui_events.py @wmvanvliet
/tutorials/visualization @larsoner @wmvanvliet
/examples/visualization @larsoner
/tutorials/visualization @larsoner @wmvanvliet @dengemann
/examples/visualization @larsoner @dengemann

# Datasets
/mne/datasets/brainstorm @jasmainak

#########################
# Project-level / other #
#########################

# Examples and tutorials
/examples @drammock @agramfort
/tutorials @drammock @agramfort
/examples @drammock @agramfort @dengemann
/tutorials @drammock @agramfort @dengemann

# Non-tutorial documentation text and infrastructure
/doc @larsoner @drammock @agramfort
/doc @larsoner @drammock @agramfort @dengemann
/logo @drammock

# Installation documentation
Expand All @@ -120,5 +126,5 @@
# Project infrastructure and CIs
/*.* @larsoner @drammock # files in the root directory
/.circleci @larsoner
/.github @larsoner @cbrnr
/.github @larsoner
/tools @larsoner @drammock
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ repos:

# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.0.292
hooks:
- id: ruff
name: ruff mne
files: ^mne/

# Ruff tutorials and examples
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.0.292
hooks:
- id: ruff
name: ruff tutorials and examples
Expand All @@ -26,7 +26,7 @@ repos:

# Codespell
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ recursive-include tutorials *.py
recursive-include tutorials *.txt

recursive-include mne *.py
recursive-include mne *.pyi
recursive-include mne/data *
recursive-include mne/icons *
recursive-include mne/data/helmets *
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ sample_data:
testing_data:
@python -c "import mne; mne.datasets.testing.data_path(verbose=True);"

pytest: test

test-no-network: in
sudo unshare -n -- sh -c 'MNE_SKIP_NETWORK_TESTS=1 py.test mne'

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The minimum required dependencies to run MNE-Python are:
- Python >= 3.8
- NumPy >= 1.21.2
- SciPy >= 1.7.1
- Matplotlib >= 3.4.3
- Matplotlib >= 3.5.0
- pooch >= 1.5
- tqdm
- Jinja2
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion doc/_static/js/contrib-avatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function putAvatarsInPage() {
}
// finish
outer.append(title, inner);
document.getElementById("institution-logos").after(outer);
document.body.append(outer);
}

putAvatarsInPage();
32 changes: 32 additions & 0 deletions doc/_static/js/set_installer_tab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/ */

function documentReady(callback) {
if (document.readyState != "loading") callback();
else document.addEventListener("DOMContentLoaded", callback);
}

function setTabs() {
var platform = "linux";
if (navigator.userAgent.indexOf("Win") !== -1) {
platform = "windows";
}
if (navigator.userAgent.indexOf("Mac") !== -1) {
// there's no good way to distinguish intel vs M1 in javascript so we
// just default to showing the first of the 2 macOS tabs
platform = "macos-intel";
}
let all_tab_nodes = document.querySelectorAll(
'.platform-selector-tabset')[0].children;
let input_nodes = [...all_tab_nodes].filter(
child => child.nodeName === "INPUT");
let tab_label_nodes = [...document.querySelectorAll('.sd-tab-label')];
let correct_label = tab_label_nodes.filter(
// label.id is drawn from :name: property in the rST, which must
// be unique across the whole site (*sigh*)
label => label.id.startsWith(platform))[0];
let input_id = correct_label.getAttribute('for');
let correct_input = input_nodes.filter(node => node.id === input_id)[0];
correct_input.checked = true;
}

documentReady(setTabs);
61 changes: 61 additions & 0 deletions doc/_static/js/update_installer_version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/ */

function documentReady(callback) {
if (document.readyState != "loading") callback();
else document.addEventListener("DOMContentLoaded", callback);
}

async function getRelease() {
result = await fetch("https://api.github.com/repos/mne-tools/mne-installers/releases/latest");
data = await result.json();
return data;
}
async function warnVersion() {
data = await getRelease();
// Take v1.5.1 for example and change to 1.5
ids = ["linux-installers", "macos-intel-installers", "macos-apple-installers", "windows-installers"];
warn = false;
ids.forEach((id) => {
label_id = document.getElementById(id);
// tab is immediately after label
children = [].slice.call(label_id.parentNode.children);
div = children[children.indexOf(label_id) + 1];
a = div.children[0].children[0]; // div->p->a
ending = a.href.split("-").slice(-1)[0]; // Should be one of: ["macOS_Intel.pkg", "macOS_M1.pkg", "Linux.sh", "Windows.exe"]
data["assets"].every((asset) => {
// find the matching asset
if (!asset["browser_download_url"].endsWith(ending)) {
return true; // continue
}
old_stem = a.href.split("/").slice(-1)[0];
new_stem = asset["browser_download_url"].split("/").slice(-1)[0];
a.href = asset["browser_download_url"];
// also replace the command on Linux
if (ending === "Linux.sh") {
code = document.getElementById("codecell0");
}
if (!warn) {
// MNE-Python-1.5.1_0-Linux.sh to 1.5 for example
old_ver = old_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join(".");
new_ver = new_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join(".");
if (old_ver !== new_ver) {
warn = `The installers below are for version ${new_ver} as ${old_ver} is no longer supported`;
}
}
return false; // do not continue
});
});
if (warn) {
let outer = document.createElement("div");
let title = document.createElement("p");
let inner = document.createElement("p");
outer.setAttribute("class", "admonition warning");
title.setAttribute("class", "admonition-title");
title.innerText = "Warning";
inner.innerText = warn;
outer.append(title, inner);
document.querySelectorAll('.platform-selector-tabset')[0].before(outer);
}
}

documentReady(warnVersion);
2 changes: 2 additions & 0 deletions doc/_templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@
</div>
{% endfor %}
</div>
<!-- contributors -->
{% include 'avatars.html' %}
</div>
3 changes: 0 additions & 3 deletions doc/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@
{%- block scripts_end %}
{{ super() }}
<script src="https://mne.tools/versionwarning.js"></script>
{% if pagename == 'index' %}
<script src="{{ pathto('_static/js/contrib-avatars.js', 1) }}"></script>
{% endif %}
{%- endblock %}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 15 additions & 2 deletions doc/changes/devel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,30 @@ Version 1.6.dev0 (development)

Enhancements
~~~~~~~~~~~~
- Improve tests for saving splits with `Epochs` (:gh:`11884` by `Dmitrii Altukhov`_)
- Improve tests for saving splits with :class:`mne.Epochs` (:gh:`11884` by `Dmitrii Altukhov`_)
- Added functionality for linking interactive figures together, such that changing one figure will affect another, see :ref:`tut-ui-events` and :mod:`mne.viz.ui_events`. Current figures implementing UI events are :func:`mne.viz.plot_topomap` and :func:`mne.viz.plot_source_estimates` (:gh:`11685` :gh:`11891` by `Marijn van Vliet`_)
- HTML anchors for :class:`mne.Report` now reflect the ``section-title`` of the report items rather than using a global incrementor ``global-N`` (:gh:`11890` by `Eric Larson`_)
- Added public :func:`mne.io.write_info` to complement :func:`mne.io.read_info` (:gh:`11918` by `Eric Larson`_)
- Added option ``remove_dc`` to to :meth:`Raw.compute_psd() <mne.io.Raw.compute_psd>`, :meth:`Epochs.compute_psd() <mne.Epochs.compute_psd>`, and :meth:`Evoked.compute_psd() <mne.Evoked.compute_psd>`, to allow skipping DC removal when computing Welch or multitaper spectra (:gh:`11769` by `Nikolai Chapochnikov`_)
- Add the possibility to provide a float between 0 and 1 as ``n_grad``, ``n_mag`` and ``n_eeg`` in `~mne.compute_proj_raw`, `~mne.compute_proj_epochs` and `~mne.compute_proj_evoked` to select the number of vectors based on the cumulative explained variance (:gh:`11919` by `Mathieu Scheltienne`_)
- Add extracting all time courses in a label using :func:`mne.extract_label_time_course` without applying an aggregation function (like ``mean``) (:gh:`12001` by `Hamza Abdelhedi`_)
- Added support for Artinis fNIRS data files to :func:`mne.io.read_raw_snirf` (:gh:`11926` by `Robert Luke`_)
- Add helpful error messages when using methods on empty :class:`mne.Epochs`-objects (:gh:`11306` by `Martin Schulz`_)
- Add support for passing a :class:`python:dict` as ``sensor_color`` to specify per-channel-type colors in :func:`mne.viz.plot_alignment` (:gh:`12067` by `Eric Larson`_)
- Add inferring EEGLAB files' montage unit automatically based on estimated head radius using :func:`read_raw_eeglab(..., montage_units="auto") <mne.io.read_raw_eeglab>` (:gh:`11925` by `Jack Zhang`_, :gh:`11951` by `Eric Larson`_)
- Add :class:`~mne.time_frequency.EpochsSpectrumArray` and :class:`~mne.time_frequency.SpectrumArray` to support creating power spectra from :class:`NumPy array <numpy.ndarray>` data (:gh:`11803` by `Alex Rockhill`_)
- Add support for writing forward solutions to HDF5 and convenience function :meth:`mne.Forward.save` (:gh:`12036` by `Eric Larson`_)
- Refactored internals of :func:`mne.read_annotations` (:gh:`11964` by `Paul Roujansky`_)
- By default MNE-Python creates matplotlib figures with ``layout='constrained'`` rather than the default ``layout='tight'`` (:gh:`12050` by `Mathieu Scheltienne`_ and `Eric Larson`_)
- Enhance :func:`~mne.viz.plot_evoked_field` with a GUI that has controls for time, colormap, and contour lines (:gh:`11942` by `Marijn van Vliet`_)
- Add :class:`mne.viz.ui_events.UIEvent` linking for interactive colorbars, allowing users to link figures and change the colormap and limits interactively. This supports :func:`~mne.viz.plot_evoked_topomap`, :func:`~mne.viz.plot_ica_components`, :func:`~mne.viz.plot_tfr_topomap`, :func:`~mne.viz.plot_projs_topomap`, :meth:`~mne.Evoked.plot_image`, and :meth:`~mne.Epochs.plot_image` (:gh:`12057` by `Santeri Ruuskanen`_)

Bugs
~~~~
- Fix bugs with :func:`mne.preprocessing.realign_raw` where the start of ``other`` was incorrectly cropped; and onsets and durations in ``other.annotations`` were left unsynced with the resampled data (:gh:`11950` by :newcontrib:`Qian Chu`)
- Fix bug where ``encoding`` argument was ignored when reading annotations from an EDF file (:gh:`11958` by :newcontrib:`Andrew Gilbert`)
- Mark tests ``test_adjacency_matches_ft`` and ``test_fetch_uncompressed_file`` as network tests (:gh:`12041` by :newcontrib:`Maksym Balatsko`)
- Fix bug with :func:`mne.channels.read_ch_adjacency` (:gh:`11608` by :newcontrib:`Ivan Zubarev`)
- Fix bugs with saving splits for :class:`~mne.Epochs` (:gh:`11876` by `Dmitrii Altukhov`_)
- Fix bug with multi-plot 3D rendering where only one plot was updated (:gh:`11896` by `Eric Larson`_)
- Fix bug where subject birthdays were not correctly read by :func:`mne.io.read_raw_snirf` (:gh:`11912` by `Eric Larson`_)
Expand All @@ -53,10 +60,16 @@ Bugs
- Fix bug with :meth:`~mne.viz.Brain.add_annotation` when reading an annotation from a file with both hemispheres shown (:gh:`11946` by `Marijn van Vliet`_)
- Fix bug with axis clip box boundaries in :func:`mne.viz.plot_evoked_topo` and related functions (:gh:`11999` by `Eric Larson`_)
- Fix bug with ``subject_info`` when loading data from and exporting to EDF file (:gh:`11952` by `Paul Roujansky`_)
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` :gh:`12017` by `Paul Roujansky`_)
- Fix bug with delayed checking of :class:`info["bads"] <mne.Info>` (:gh:`12038` by `Eric Larson`_)
- Fix bug with :func:`mne.viz.plot_alignment` where ``sensor_colors`` were not handled properly on a per-channel-type basis (:gh:`12067` by `Eric Larson`_)
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` :gh:`12017` :gh:`12044` by `Paul Roujansky`_)
- Add missing ``overwrite`` and ``verbose`` parameters to :meth:`Transform.save() <mne.transforms.Transform.save>` (:gh:`12004` by `Marijn van Vliet`_)
- Fix parsing of eye-link :class:`~mne.Annotations` when ``apply_offsets=False`` is provided to :func:`~mne.io.read_raw_eyelink` (:gh:`12003` by `Mathieu Scheltienne`_)
- Correctly prune channel-specific :class:`~mne.Annotations` when creating :class:`~mne.Epochs` without the channel(s) included in the channel specific annotations (:gh:`12010` by `Mathieu Scheltienne`_)
- Fix :func:`~mne.viz.plot_volume_source_estimates` with :class:`~mne.VolSourceEstimate` which include a list of vertices (:gh:`12025` by `Mathieu Scheltienne`_)
- Add support for non-ASCII characters in Annotations, Evoked comments, etc when saving to FIFF format (:gh:`12080` by `Daniel McCloy`_)
- Correctly handle passing ``"eyegaze"`` or ``"pupil"`` to :meth:`mne.io.Raw.pick` (:gh:`12019` by `Scott Huberty`_)
- Fix bug with :func:`~mne.viz.plot_raw` where changing ``MNE_BROWSER_BACKEND`` via :func:`~mne.set_config` would have no effect within a Python session (:gh:`12078` by `Santeri Ruuskanen`_)

API changes
~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
.. _George O'Neill: https://georgeoneill.github.io

.. _Gonzalo Reina: https://greina.me/

.. _Guillaume Dumas: https://mila.quebec/en/person/guillaume-dumas

.. _Guillaume Favelier: https://github.com/GuillaumeFavelier
Expand All @@ -210,6 +212,8 @@

.. _Ilias Machairas: https://github.com/JungleHippo

.. _Ivan Zubarev: https://github.com/zubara

.. _Ivana Kojcic: https://github.com/ikojcic

.. _Jaakko Leppakangas: https://github.com/jaeilepp
Expand Down Expand Up @@ -320,6 +324,8 @@

.. _Mainak Jas: https://jasmainak.github.io

.. _Maksym Balatsko: https://github.com/mbalatsko

.. _Marcin Koculak: https://github.com/mkoculak

.. _Marian Dovgialo: https://github.com/mdovgialo
Expand Down
Loading

0 comments on commit f952d58

Please sign in to comment.