Skip to content

Commit

Permalink
Merge branch 'main' into doc
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Oct 23, 2024
2 parents af4cde5 + 97f5b9c commit 95018ca
Show file tree
Hide file tree
Showing 19 changed files with 528 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .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.6.9
rev: v0.7.0
hooks:
- id: ruff
name: ruff lint mne
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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 pytest-error-for-skips python-picard qtpy nibabel sphinx-gallery PySide6
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 pytest-error-for-skips python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1"
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 @@ -201,7 +201,7 @@ stages:
displayName: 'PyQt6'
- bash: |
set -eo pipefail
python -m pip install PySide6
python -m pip install "PySide6!=6.8.0,!=6.8.0.1"
mne sys_info -pd
mne sys_info -pd | grep "qtpy .* (PySide6=.*)$"
PYTEST_QT_API=PySide6 pytest ${TEST_OPTIONS}
Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel/12901.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:class:`mne.Report` HDF5 files are now written in ``mode='a'`` (append) to allow users to store other data in the HDF5 files, by `Eric Larson`_.
8 changes: 8 additions & 0 deletions doc/changes/devel/12901.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Improved reporting and plotting options:

- :meth:`mne.Report.add_projs` can now plot with :func:`mne.viz.plot_projs_joint` rather than :func:`mne.viz.plot_projs_topomap`
- :class:`mne.Report` now has attributes ``img_max_width`` and ``img_max_res`` that can be used to control image scaling.
- :class:`mne.Report` now has an attribute ``collapse`` that allows collapsing sections and/or subsections by default.
- :func:`mne.viz.plot_head_positions` now has a ``totals=True`` option to show the total distance and angle of the head.

Changes by `Eric Larson`_.
1 change: 1 addition & 0 deletions doc/changes/devel/12909.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in :func:`mne.io.read_raw_gdf` when NumPy >= 2 is used, by `Clemens Brunner`_.
24 changes: 12 additions & 12 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: mne
channels:
- conda-forge
dependencies:
- python>=3.10
- python >=3.10
- pip
- numpy
- scipy
Expand All @@ -28,25 +28,25 @@ dependencies:
- psutil
- numexpr
- imageio
- spyder-kernels>=1.10.0
- imageio>=2.6.1
- imageio-ffmpeg>=0.4.1
- vtk>=9.2
- spyder-kernels >=1.10.0
- imageio >=2.6.1
- imageio-ffmpeg >=0.4.1
- vtk >=9.2
- traitlets
- pyvista>=0.32,!=0.35.2,!=0.38.0,!=0.38.1,!=0.38.2,!=0.38.3,!=0.38.4,!=0.38.5,!=0.38.6,!=0.42.0
- pyvistaqt>=0.4
- qdarkstyle!=3.2.2
- pyvista >=0.32,!=0.35.2,!=0.38.0,!=0.38.1,!=0.38.2,!=0.38.3,!=0.38.4,!=0.38.5,!=0.38.6,!=0.42.0
- pyvistaqt >=0.4
- qdarkstyle !=3.2.2
- darkdetect
- dipy
- nibabel
- openmeeg>=2.5.5
- openmeeg >=2.5.5
- nilearn
- python-picard
- qtpy
- pyside6
- pyside6 !=6.8.0,!=6.8.0.1
- mne-base
- seaborn-base
- mffpy>=0.5.7
- mffpy >=0.5.7
- ipyevents
- ipywidgets
- ipympl
Expand All @@ -59,7 +59,7 @@ dependencies:
- mne-qt-browser
- pymatreader
- eeglabio
- edfio>=0.2.1
- edfio >=0.2.1
- pybv
- mamba
- lazy_loader
Expand Down
8 changes: 2 additions & 6 deletions mne/html_templates/report/html.html.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div class="accordion-item {{ div_klass }}" id="{{ id }}" data-mne-tags="{% for tag in tags %} {{ tag }} {% endfor %}">
<div class="accordion-header" id="accordion-header-{{id}}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse"
data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{id}}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{id}}">
<div class="w-100">
<span class="me-auto"><a href="#{{ id }}" class="text-decoration-none">{{ title }}</a></span>
{% for tag in tags %}
Expand All @@ -12,10 +11,7 @@
</div>
</button>
</div>


<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse {{ show }}" aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
{{ html | safe }}
</div>
Expand Down
26 changes: 13 additions & 13 deletions mne/html_templates/report/image.html.jinja
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{% extends "section.html.jinja" %}
{% block html_content %}
<figure class="figure mx-auto d-block">
{% if image_format == 'svg' %}
<div class="d-flex justify-content-center">
{{ img|safe }}
</div>
{% else %}
<img class="figure-img img-fluid rounded mx-auto my-0 d-block" alt="{{ title }}"
src="data:image/{{ image_format }};base64,{{ img }}">
{% endif %}
<figure class="figure mx-auto d-block">
{% if image_format == 'svg' %}
<div class="d-flex justify-content-center">
{{ img|safe }}
</div>
{% else %}
<img class="figure-img img-fluid rounded mx-auto my-0 d-block" alt="{{ title }}"
src="data:image/{{ image_format }};base64,{{ img }}">
{% endif %}

{% if caption is not none %}
<figcaption class="figure-caption text-center">{{ caption }}</figcaption>
{% endif %}
</figure>
{% if caption is not none %}
<figcaption class="figure-caption text-center">{{ caption }}</figcaption>
{% endif %}
</figure>
{% endblock html_content %}
8 changes: 2 additions & 6 deletions mne/html_templates/report/section.html.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div class="accordion-item {{ div_klass }}" id="{{ id }}" data-mne-tags="{% for tag in tags %} {{ tag }} {% endfor %}">
<div class="accordion-header" id="accordion-header-{{id}}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse"
data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{id}}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{id}}">
<div class="w-100">
<span class="me-auto"><a href="#{{ id }}" class="text-decoration-none">{{ title }}</a></span>
{% for tag in tags %}
Expand All @@ -12,10 +11,7 @@
</div>
</button>
</div>


<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse {{ show }}" aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
{% block html_content %}
{% for html in htmls %}
Expand Down
12 changes: 3 additions & 9 deletions mne/html_templates/report/slider.html.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div class="accordion-item slider {{ klass }}" id="{{ id }}"
data-mne-tags="{% for tag in tags %} {{ tag }} {% endfor %}">
<div class="accordion-header" id="accordion-header-{{ id }}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse"
data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{ id }}">
<button class="accordion-button pt-1 pb-1" type="button" data-bs-toggle="collapse" data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{ id }}">
<div class="w-100">
<span class="me-auto"><a href="#{{ id }}" class="text-decoration-none">{{ title }}</a></span>
{% for tag in tags %}
Expand All @@ -13,9 +12,7 @@
</div>
</button>
</div>

<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse {{ show }}" aria-labelledby="accordion-header-{{ id }}">
<div class=" accordion-body">
<div class="mx-auto d-block w-75">
<label for="slider-{{ id }}" class="form-label small">
Expand All @@ -24,9 +21,7 @@
<input type="range" class="form-range" min="0" max="{{ images|length - 1 }}" value="{{ start_idx }}"
id="slider-{{id}}">
</div>

<div id="corousel-{{ id }}" class="carousel carousel-dark" data-bs-interval="false" data-bs-wrap="false"
data-bs-keyboard="true">
<div id="corousel-{{ id }}" class="carousel carousel-dark" data-bs-interval="false" data-bs-wrap="false" data-bs-keyboard="true">
<div class="carousel-inner">
{% for idx, img, caption in range(images|length)|zip(images, captions) %}
<div class="carousel-item {% if idx == start_idx %}active{% endif %}">
Expand All @@ -40,7 +35,6 @@
</div>
{% endfor %}
</div>

{# <button class="carousel-control-prev" type="button" data-bs-target="#corousel-{{id}}" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
Expand Down
2 changes: 1 addition & 1 deletion mne/io/edf/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ def _read_gdf_header(fname, exclude, include=None):
ne = np.fromfile(fid, UINT8, 3)
n_events = ne[0]
for i in range(1, len(ne)):
n_events = n_events + ne[i] * 2 ** (i * 8)
n_events = n_events + int(ne[i]) * 2 ** (i * 8)
event_sr = np.fromfile(fid, FLOAT32, 1)[0]

pos = np.fromfile(fid, UINT32, n_events) - 1 # 1-based inds
Expand Down
Loading

0 comments on commit 95018ca

Please sign in to comment.