Skip to content

Commit a43d363

Browse files
committed
Merge remote-tracking branch 'upstream/main' into new-curry-reader
2 parents 7260675 + c31ae1d commit a43d363

5 files changed

Lines changed: 53 additions & 12 deletions

File tree

doc/_static/js/custom-icons.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FontAwesome.library.add(
2+
/**
3+
* Custom icon definitions
4+
*
5+
* see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/header-links.html#svg-image-icons
6+
*/
7+
{
8+
prefix: "fa-custom",
9+
iconName: "opencollective",
10+
icon: [
11+
24,
12+
24,
13+
[],
14+
"e001",
15+
// https://simpleicons.org/icons/opencollective.svg
16+
"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12c2.54 0 4.894-.79 6.834-2.135l-3.107-3.109a7.715 7.715 0 1 1 0-13.512l3.107-3.109A11.943 11.943 0 0 0 12 0zm9.865 5.166l-3.109 3.107A7.67 7.67 0 0 1 19.715 12a7.682 7.682 0 0 1-.959 3.727l3.109 3.107A11.943 11.943 0 0 0 24 12c0-2.54-.79-4.894-2.135-6.834z",
17+
],
18+
},
19+
);

doc/_static/style.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ html[data-theme="light"] {
3131
--mne-color-github: #000;
3232
--mne-color-discourse: #d0232b;
3333
--mne-color-mastodon: #2F0C7A;
34+
--mne-color-sponsor: #BF3989; /* from GH sponsor heart, via browser devtools */
35+
--mne-color-opencollective: #1F87FF; /* scraped from logo SVG */
3436
/* code block copy button */
3537
--copybtn-opacity: 0.75;
3638
/* card header bg color */
@@ -63,6 +65,8 @@ html[data-theme="dark"] {
6365
--mne-color-github: rgb(240, 246, 252); /* from their logo SVG */
6466
--mne-color-discourse: #FFF9AE; /* from their logo SVG */
6567
--mne-color-mastodon: #858AFA; /* www.joinmastodon.org/en/branding */
68+
--mne-color-sponsor: #DB61A2; /* from GH sponsor heart, via browser devtools */
69+
--mne-color-opencollective: #99CFFF; /* scraped from logo SVG */
6670
/* code block copy button */
6771
--copybtn-opacity: 0.25;
6872
/* card header bg color */
@@ -253,7 +257,7 @@ aside.footnote:last-child {
253257
}
254258

255259
/* ******************************************************* navbar icon links */
256-
.navbar-icon-links svg.fa-square-github {
260+
.navbar-icon-links svg.fa-github {
257261
color: var(--mne-color-github);
258262
}
259263
.navbar-icon-links svg.fa-discourse {
@@ -265,6 +269,12 @@ aside.footnote:last-child {
265269
.navbar-icon-links svg.fa-mastodon {
266270
color: var(--mne-color-mastodon);
267271
}
272+
.navbar-icon-links svg.fa-heart {
273+
color: var(--mne-color-sponsor);
274+
}
275+
.navbar-icon-links svg.fa-opencollective {
276+
color: var(--mne-color-opencollective);
277+
}
268278

269279
/* ************************************************************ nav elements */
270280
/* topbar nav inactive */

doc/conf.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
780780
html_theme_options = {
781781
"icon_links": [
782782
dict(
783-
name="Discord",
783+
name="Discord (office hours)",
784784
url="https://discord.gg/rKfvxTuATa",
785785
icon="fa-brands fa-discord fa-fw",
786786
),
@@ -791,14 +791,24 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
791791
attributes=dict(rel="me"),
792792
),
793793
dict(
794-
name="Forum",
794+
name="Q&A Forum",
795795
url="https://mne.discourse.group/",
796796
icon="fa-brands fa-discourse fa-fw",
797797
),
798798
dict(
799-
name="GitHub",
799+
name="Code Repository",
800800
url="https://github.com/mne-tools/mne-python",
801-
icon="fa-brands fa-square-github fa-fw",
801+
icon="fa-brands fa-github fa-fw",
802+
),
803+
dict(
804+
name="Sponsor us on GitHub",
805+
url="https://github.com/sponsors/mne-tools",
806+
icon="fa-regular fa-heart fa-fw",
807+
),
808+
dict(
809+
name="Donate via OpenCollective",
810+
url="https://opencollective.com/mne-python",
811+
icon="fa-custom fa-opencollective fa-fw",
802812
),
803813
],
804814
"icon_links_label": "External Links", # for screen reader
@@ -840,6 +850,9 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
840850
html_css_files = [
841851
"style.css",
842852
]
853+
html_js_files = [
854+
("js/custom-icons.js", {"defer": "defer"}),
855+
]
843856

844857
# Add any extra paths that contain custom files (such as robots.txt or
845858
# .htaccess) here, relative to this directory. These files are copied

mne/viz/_brain/_brain.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,6 @@ def __init__(
441441
name="curv",
442442
)
443443
self._layered_meshes[h] = mesh
444-
# add metadata to the mesh for picking
445-
mesh._polydata._hemi = h
446444
else:
447445
actor = self._layered_meshes[h]._actor
448446
self._renderer.plotter.add_actor(actor, render=False)
@@ -1248,12 +1246,12 @@ def _on_pick(self, vtk_picker, event):
12481246
return
12491247

12501248
# 3) Otherwise, pick the objects in the scene
1251-
try:
1252-
hemi = mesh._hemi
1253-
except AttributeError: # volume
1254-
hemi = "vol"
1249+
for hemi, this_mesh in self._layered_meshes.items():
1250+
assert hemi in ("lh", "rh"), f"Unexpected {hemi=}"
1251+
if this_mesh._polydata is mesh:
1252+
break
12551253
else:
1256-
assert hemi in ("lh", "rh")
1254+
hemi = "vol"
12571255
if self.act_data_smooth[hemi][0] is None: # no data to add for hemi
12581256
return
12591257
pos = np.array(vtk_picker.GetPickPosition())

mne/viz/_brain/tests/test_brain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ def test_single_hemi(hemi, renderer_interactive_pyvistaqt, brain_gc):
774774
@pytest.mark.parametrize("interactive_state", (False, True))
775775
def test_brain_save_movie(tmp_path, renderer, brain_gc, interactive_state):
776776
"""Test saving a movie of a Brain instance."""
777+
pytest.importorskip("imageio")
777778
imageio_ffmpeg = pytest.importorskip("imageio_ffmpeg")
778779

779780
brain = _create_testing_brain(

0 commit comments

Comments
 (0)