Skip to content

Commit 5a83eae

Browse files
authored
MAINT: Fix broken examples (mne-tools#12074)
1 parent cedefa0 commit 5a83eae

File tree

5 files changed

+10
-44
lines changed

5 files changed

+10
-44
lines changed

doc/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,7 @@ def reset_warnings(gallery_conf, fname):
16211621
co = "connectivity"
16221622
mne_conn = "https://mne.tools/mne-connectivity/stable"
16231623
tu = "auto_tutorials"
1624+
pr = "preprocessing"
16241625
di = "discussions"
16251626
sm = "source-modeling"
16261627
fw = "forward"
@@ -1666,7 +1667,7 @@ def reset_warnings(gallery_conf, fname):
16661667
f"{tu}/{sd}/plot_phantom_4DBTi.html": f"{tu}/{nv}/90_phantom_4DBTi.html",
16671668
f"{tu}/{sd}/plot_brainstorm_auditory.html": f"{tu}/io/60_ctf_bst_auditory.html",
16681669
f"{tu}/{sd}/plot_sleep.html": f"{tu}/clinical/60_sleep.html",
1669-
f"{tu}/{di}/plot_background_filtering.html": f"{tu}/preprocessing/25_background_filtering.html", # noqa E501
1670+
f"{tu}/{di}/plot_background_filtering.html": f"{tu}/{pr}/25_background_filtering.html", # noqa E501
16701671
f"{tu}/{di}/plot_background_statistics.html": f"{tu}/{sn}/10_background_stats.html",
16711672
f"{tu}/{sn}/plot_stats_cluster_erp.html": f"{tu}/{sn}/20_erp_stats.html",
16721673
f"{tu}/{sn}/plot_stats_cluster_1samp_test_time_frequency.html": f"{tu}/{sn}/40_cluster_1samp_time_freq.html", # noqa E501
@@ -1681,7 +1682,7 @@ def reset_warnings(gallery_conf, fname):
16811682
f"{tu}/{si}/plot_creating_data_structures.html": f"{tu}/{si}/10_array_objs.html",
16821683
f"{tu}/{si}/plot_point_spread.html": f"{tu}/{si}/70_point_spread.html",
16831684
f"{tu}/{si}/plot_dics.html": f"{tu}/{si}/80_dics.html",
1684-
f"{tu}/{tf}/plot_eyetracking.html": f"{tu}/preprocessing/90_eyetracking_data.html",
1685+
f"{tu}/{tf}/plot_eyetracking.html": f"{tu}/{pr}/90_eyetracking_data.html",
16851686
f"{ex}/{co}/mne_inverse_label_connectivity.html": f"{mne_conn}/{ex}/mne_inverse_label_connectivity.html", # noqa E501
16861687
f"{ex}/{co}/cwt_sensor_connectivity.html": f"{mne_conn}/{ex}/cwt_sensor_connectivity.html", # noqa E501
16871688
f"{ex}/{co}/mixed_source_space_connectivity.html": f"{mne_conn}/{ex}/mixed_source_space_connectivity.html", # noqa E501
@@ -1692,6 +1693,7 @@ def reset_warnings(gallery_conf, fname):
16921693
f"{ex}/{co}/mne_inverse_psi_visual.html": f"{mne_conn}/{ex}/mne_inverse_psi_visual.html", # noqa E501
16931694
f"{ex}/{co}/sensor_connectivity.html": f"{mne_conn}/{ex}/sensor_connectivity.html",
16941695
f"{ex}/{vi}/publication_figure.html": f"{tu}/{vi}/10_publication_figure.html",
1696+
f"{ex}/{vi}/sensor_noise_level.html": f"{tu}/{pr}/50_artifact_correction_ssp.html",
16951697
}
16961698

16971699

examples/visualization/sensor_noise_level.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

mne/viz/_brain/_brain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,8 @@ def add_sensors(
28392839
self._units,
28402840
sensor_colors=sensor_colors,
28412841
)
2842-
for item, actors in sensors_actors.items():
2842+
# sensors_actors can still be None
2843+
for item, actors in (sensors_actors or {}).items():
28432844
for actor in actors:
28442845
self._add_actor(item, actor)
28452846

tutorials/io/30_reading_fnirs_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
Continuous Wave Devices
7474
***********************
7575
76-
7776
.. _import-nirx:
7877
7978
NIRx (directory or hdr)

tutorials/preprocessing/50_artifact_correction_ssp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,17 @@
9999
empty_room_raw.del_proj()
100100

101101
# %%
102+
#
103+
# _ex-noise-level:
104+
#
102105
# Visualizing the empty-room noise
103106
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104107
#
105108
# Let's take a look at the spectrum of the empty room noise. We can view an
106109
# individual spectrum for each sensor, or an average (with confidence band)
107110
# across sensors:
108111

109-
spectrum = empty_room_raw.compute_psd()
112+
spectrum = empty_room_raw.compute_psd(verbose="error") # ignore zero value warning
110113
for average in (False, True):
111114
spectrum.plot(average=average, dB=False, xscale="log", picks="data", exclude="bads")
112115

0 commit comments

Comments
 (0)