Skip to content

Commit 6b5a59d

Browse files
cbrnrlarsoner
andauthored
Show bad channels in gray (#12548)
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent 4767ff5 commit 6b5a59d

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

doc/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
774774
# -- Nitpicky ----------------------------------------------------------------
775775

776776
nitpicky = True
777+
show_warning_types = True
777778
nitpick_ignore = [
778779
("py:class", "None. Remove all items from D."),
779780
("py:class", "a set-like object providing a view on D's items"),
@@ -803,7 +804,10 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
803804
"(filename|metadata|proj|times|tmax|tmin|annotations|ch_names|compensation_grade|filenames|first_samp|first_time|last_samp|n_times|proj|times|tmax|tmin)",
804805
), # noqa: E501
805806
]
806-
suppress_warnings = ["image.nonlocal_uri"] # we intentionally link outside
807+
suppress_warnings = [
808+
"image.nonlocal_uri", # we intentionally link outside
809+
"config.cache", # our rebuild is okay
810+
]
807811

808812

809813
# -- Sphinx hacks / overrides ------------------------------------------------

mne/viz/raw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def plot_raw(
313313
ch_names = np.array(raw.ch_names)
314314
ch_types = np.array(raw.get_channel_types())
315315

316-
picks = _picks_to_idx(info, picks, none="all")
316+
picks = _picks_to_idx(info, picks, none="all", exclude=())
317317
order = _get_channel_plotting_order(order, ch_types, picks=picks)
318318
n_channels = min(info["nchan"], n_channels, len(order))
319319
# adjust order based on channel selection, if needed

mne/viz/tests/test_raw.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ def test_plot_raw_traces(raw, events, browser_backend):
541541
ismpl = browser_backend.name == "matplotlib"
542542
with raw.info._unlock():
543543
raw.info["lowpass"] = 10.0 # allow heavy decim during plotting
544+
assert raw.info["bads"] == []
544545
fig = raw.plot(
545546
events=events, order=[1, 7, 5, 2, 3], n_channels=3, group_by="original"
546547
)
@@ -623,6 +624,12 @@ def test_plot_raw_traces(raw, events, browser_backend):
623624
raw.plot(event_color={"foo": "r"})
624625
plot_raw(raw, events=events, event_color={-1: "r", 998: "b"})
625626

627+
# gh-12547
628+
raw.info["bads"] = raw.ch_names[1:2]
629+
picks = [1, 7, 5, 2, 3]
630+
fig = raw.plot(events=events, order=picks, group_by="original")
631+
assert_array_equal(fig.mne.picks, picks)
632+
626633

627634
def test_plot_raw_picks(raw, browser_backend):
628635
"""Test functionality of picks and order arguments."""

0 commit comments

Comments
 (0)