Skip to content

Commit

Permalink
MAINT: Fix broken examples (#12074)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Oct 5, 2023
1 parent cedefa0 commit 5a83eae
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 44 deletions.
6 changes: 4 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,7 @@ def reset_warnings(gallery_conf, fname):
co = "connectivity"
mne_conn = "https://mne.tools/mne-connectivity/stable"
tu = "auto_tutorials"
pr = "preprocessing"
di = "discussions"
sm = "source-modeling"
fw = "forward"
Expand Down Expand Up @@ -1666,7 +1667,7 @@ def reset_warnings(gallery_conf, fname):
f"{tu}/{sd}/plot_phantom_4DBTi.html": f"{tu}/{nv}/90_phantom_4DBTi.html",
f"{tu}/{sd}/plot_brainstorm_auditory.html": f"{tu}/io/60_ctf_bst_auditory.html",
f"{tu}/{sd}/plot_sleep.html": f"{tu}/clinical/60_sleep.html",
f"{tu}/{di}/plot_background_filtering.html": f"{tu}/preprocessing/25_background_filtering.html", # noqa E501
f"{tu}/{di}/plot_background_filtering.html": f"{tu}/{pr}/25_background_filtering.html", # noqa E501
f"{tu}/{di}/plot_background_statistics.html": f"{tu}/{sn}/10_background_stats.html",
f"{tu}/{sn}/plot_stats_cluster_erp.html": f"{tu}/{sn}/20_erp_stats.html",
f"{tu}/{sn}/plot_stats_cluster_1samp_test_time_frequency.html": f"{tu}/{sn}/40_cluster_1samp_time_freq.html", # noqa E501
Expand All @@ -1681,7 +1682,7 @@ def reset_warnings(gallery_conf, fname):
f"{tu}/{si}/plot_creating_data_structures.html": f"{tu}/{si}/10_array_objs.html",
f"{tu}/{si}/plot_point_spread.html": f"{tu}/{si}/70_point_spread.html",
f"{tu}/{si}/plot_dics.html": f"{tu}/{si}/80_dics.html",
f"{tu}/{tf}/plot_eyetracking.html": f"{tu}/preprocessing/90_eyetracking_data.html",
f"{tu}/{tf}/plot_eyetracking.html": f"{tu}/{pr}/90_eyetracking_data.html",
f"{ex}/{co}/mne_inverse_label_connectivity.html": f"{mne_conn}/{ex}/mne_inverse_label_connectivity.html", # noqa E501
f"{ex}/{co}/cwt_sensor_connectivity.html": f"{mne_conn}/{ex}/cwt_sensor_connectivity.html", # noqa E501
f"{ex}/{co}/mixed_source_space_connectivity.html": f"{mne_conn}/{ex}/mixed_source_space_connectivity.html", # noqa E501
Expand All @@ -1692,6 +1693,7 @@ def reset_warnings(gallery_conf, fname):
f"{ex}/{co}/mne_inverse_psi_visual.html": f"{mne_conn}/{ex}/mne_inverse_psi_visual.html", # noqa E501
f"{ex}/{co}/sensor_connectivity.html": f"{mne_conn}/{ex}/sensor_connectivity.html",
f"{ex}/{vi}/publication_figure.html": f"{tu}/{vi}/10_publication_figure.html",
f"{ex}/{vi}/sensor_noise_level.html": f"{tu}/{pr}/50_artifact_correction_ssp.html",
}


Expand Down
39 changes: 0 additions & 39 deletions examples/visualization/sensor_noise_level.py

This file was deleted.

3 changes: 2 additions & 1 deletion mne/viz/_brain/_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,8 @@ def add_sensors(
self._units,
sensor_colors=sensor_colors,
)
for item, actors in sensors_actors.items():
# sensors_actors can still be None
for item, actors in (sensors_actors or {}).items():
for actor in actors:
self._add_actor(item, actor)

Expand Down
1 change: 0 additions & 1 deletion tutorials/io/30_reading_fnirs_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
Continuous Wave Devices
***********************
.. _import-nirx:
NIRx (directory or hdr)
Expand Down
5 changes: 4 additions & 1 deletion tutorials/preprocessing/50_artifact_correction_ssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@
empty_room_raw.del_proj()

# %%
#
# _ex-noise-level:
#
# Visualizing the empty-room noise
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Let's take a look at the spectrum of the empty room noise. We can view an
# individual spectrum for each sensor, or an average (with confidence band)
# across sensors:

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

Expand Down

0 comments on commit 5a83eae

Please sign in to comment.