Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into proj_joint
Browse files Browse the repository at this point in the history
* upstream/main:
  MRG: In Report, allow to add multiple figure or image elements to the same content block ("section") (mne-tools#10694)
  CI: Add style conditional (mne-tools#10723)
  Fix coreg tutorial typos (mne-tools#10716)
  MAINT: Deal with nibabel deprecation (mne-tools#10719)
  • Loading branch information
larsoner committed Jun 8, 2022
2 parents 1fbc3c8 + a9b139d commit 458ebbd
Show file tree
Hide file tree
Showing 21 changed files with 935 additions and 963 deletions.
10 changes: 8 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ stages:
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off -r requirements_base.txt -r requirements_hdf5.txt -r requirements_testing.txt
displayName: Install dependencies
condition: always()
- bash: |
make flake
displayName: make flake
- bash: |
make codespell-error
displayName: make codespell
- bash: |
make pydocstyle
displayName: make pydocstyle
condition: always()
- bash: |
make docstring
displayName: make docstring
condition: always()
- bash: |
make nesting
displayName: make nesting
Expand All @@ -77,7 +83,7 @@ stages:
- stage: Test
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: Check
dependsOn: ['Style', 'Check']
variables:
AZURE_CI: 'true'
jobs:
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Enhancements

- Add timeformat ``YYYY/MM/DD`` to ``mne.io.ctf.info._convert_time`` (:gh:`10674` by `Simon Kern`_)

- :meth:`mne.Report.add_figure` and :meth:`mne.Report.add_image` gained a new parameter, ``section``, allowing to put multiple figures or images into the same "content block". Previously, the only way to group figures and images was by means of a slider, which sometimes made content hard to discover. The slider remains available as an alternative. (:gh:`10694` by `Richard Höchenberger`_)

Bugs
~~~~

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

@article{HouckClaus2020,
author = {Houck, Jon M. and Claus, Eric D.},
doi = {10.1371/journal.pone.0232100},
journal = {PLOS ONE},
pages = {e0232100},
title = {A comparison of automated and manual co-registration for magnetoencephalography},
volume = {15},
year = {2020}
}

@article{Hyvarinen1999,
author = {Hyvärinen, Aapo},
doi = {10.1109/72.761722},
Expand Down
8 changes: 8 additions & 0 deletions mne/html_templates/report/bem.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "section.html.jinja" %}
{% block html_content %}
<div class="row">
{{ html_slider_axial | safe }}
{{ html_slider_sagittal | safe }}
{{ html_slider_coronal | safe }}
</div>
{% endblock html_content %}
30 changes: 6 additions & 24 deletions mne/html_templates/report/code.html.jinja
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
<div class="accordion-item code" 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 }}">
<div class="w-100">
<span class="me-auto">{{ title }}</span>
{% for tag in tags %}
<span class="badge bg-primary rounded-pill float-end me-1" data-mne-tag="{{ tag }}">
{{ tag }}
</span>
{% endfor %}
</div>
</button>
</div>

<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
<pre class="my-0">
<code class="language-{{ language }}">{{ code }}</code>
</pre>
</div>
</div>
</div>
{% extends "section.html.jinja" %}
{% block html_content %}
<pre class="my-0">
<code class="language-{{ language }}">{{ code }}</code>
</pre>
{% endblock html_content %}
27 changes: 0 additions & 27 deletions mne/html_templates/report/epochs.html.jinja

This file was deleted.

26 changes: 0 additions & 26 deletions mne/html_templates/report/evoked.html.jinja

This file was deleted.

28 changes: 5 additions & 23 deletions mne/html_templates/report/forward.html.jinja
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
<div class="accordion-item forward-solution" 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 }}">
<div class="w-100">
<span class="me-auto">{{ title }}</span>
{% for tag in tags %}
<span class="badge bg-primary rounded-pill float-end me-1" data-mne-tag="{{ tag }}">
{{ tag }}
</span>
{% endfor %}
</div>
</button>
</div>

<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
{{repr | safe}}
{{sensitivity_maps | safe }}
</div>
</div>
</div>
{% extends "section.html.jinja" %}
{% block html_content %}
{{repr | safe}}
{{sensitivity_maps | safe}}
{% endblock html_content %}
29 changes: 0 additions & 29 deletions mne/html_templates/report/ica.html.jinja

This file was deleted.

49 changes: 15 additions & 34 deletions mne/html_templates/report/image.html.jinja
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
<div class="accordion-item {{ div_klass }}" id="{{ id }}" data-mne-tags="{% for tag in tags %} {{ tag }} {% endfor %}"
{% if not show %}style="display: none" {% endif %}>
<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 }}">
<div class="w-100">
<span class="me-auto">{{ title }}</span>
{% for tag in tags %}
<span class="badge bg-primary rounded-pill float-end me-1" data-mne-tag="{{ tag }}">
{{ tag }}
</span>
{% endfor %}
</div>
</button>
{% 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 }}
</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 %}

<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
<figure class="figure mx-auto d-block">
{% if image_format == 'svg' %}
<div class="d-flex justify-content-center">
{{ img }}
</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>
</div>
</div>
</div>
{% if caption is not none %}
<figcaption class="figure-caption text-center">{{ caption }}</figcaption>
{% endif %}
</figure>
{% endblock html_content %}
28 changes: 5 additions & 23 deletions mne/html_templates/report/inverse.html.jinja
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
<div class="accordion-item inverse-operator" 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 }}">
<div class="w-100">
<span class="me-auto">{{ title }}</span>
{% for tag in tags %}
<span class="badge bg-primary rounded-pill float-end me-1" data-mne-tag="{{ tag }}">
{{ tag }}
</span>
{% endfor %}
</div>
</button>
</div>

<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
{{repr | safe}}
{{source_space | safe}}
</div>
</div>
</div>
{% extends "section.html.jinja" %}
{% block html_content %}
{{repr | safe}}
{{source_space | safe}}
{% endblock html_content %}
25 changes: 0 additions & 25 deletions mne/html_templates/report/raw.html.jinja

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="accordion-item covariance" id="{{ id }}" data-mne-tags="{% for tag in tags %} {{ tag }} {% endfor %}">
<div class="accordion-header" id="accordion-header-{{ id }}">
<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 }}">
data-bs-target="#accordion-collapse-{{ id }}" aria-expanded="true" aria-controls="accordion-collapse-{{id}}">
<div class="w-100">
<span class="me-auto">{{ title }}</span>
{% for tag in tags %}
Expand All @@ -13,11 +13,15 @@
</button>
</div>


<div id="accordion-collapse-{{ id }}" class="accordion-collapse collapse show"
aria-labelledby="accordion-header-{{ id }}">
<div class="accordion-body">
{{ matrix | safe }}
{{ svd | safe }}
{% block html_content %}
{% for html in htmls %}
{{ html | safe }}
{% endfor %}
{% endblock %}
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions mne/html_templates/report/toc.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="col-2 px-1 position-fixed vh-100 overflow-auto" id="toc">
<h5 class="px-1">Table of contents</h5>
<nav class="nav nav-pills flex-column lh-sm" id="toc-navbar">
{% for element in content_elements %}
<a class="nav-link list-group-item list-group-item-action text-break" href="#{{ element.dom_id }}"
data-mne-tags="{% for tag in element.tags %} {{ tag }} {% endfor %}">{{ element.name }}</a>
{% for title, dom_id, tags_ in titles|zip(dom_ids, tags) %}
<a class="nav-link list-group-item list-group-item-action text-break" href="#{{ dom_id }}"
data-mne-tags="{% for tag in tags_ %} {{ tag }} {% endfor %}">{{ title }}</a>
{% endfor %}
</nav>
</div>
Expand Down
Loading

0 comments on commit 458ebbd

Please sign in to comment.