From 90f662d91d9800daf5cbe23d5efb8129a26bcd0f Mon Sep 17 00:00:00 2001 From: Scott Huberty Date: Thu, 13 Mar 2025 11:56:19 -0700 Subject: [PATCH 1/3] FIX, DOC: Bug in plot_evoked_joint API - plot_evoked_joint had the default `exclude=None` but actually `None` is not a valid argument for this parameter! it breaks! - Also, this default was not consistent with `mne.Evoked.plot_joint` which had the default `exclude="bads"` - Further, the docstring from plot_evoked_joint got copied to mne.Evoked.plot_joint, creating a discrepancy bt the docstring and the code (i.e. doc says default is None, but default was actually "bads") --- mne/viz/evoked.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 96ee0684e6e..290dce0f815 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -1797,7 +1797,7 @@ def plot_evoked_joint( times="peaks", title="", picks=None, - exclude=None, + exclude="bads", show=True, ts_args=None, topomap_args=None, @@ -1824,9 +1824,10 @@ def plot_evoked_joint( axes are passed make sure to set ``title=None``, otherwise some of your axes may be removed during placement of the title axis. %(picks_all)s - exclude : None | list of str | 'bads' + exclude : list of str | 'bads' Channels names to exclude from being shown. If ``'bads'``, the - bad channels are excluded. Defaults to ``None``. + bad channels are excluded. If an empty list, no channels are + excluded. Defaults to ``"bads"``. show : bool Show figure if ``True``. Defaults to ``True``. ts_args : None | dict From 2f8b923e89793f31b76990b8b0020cd61838330f Mon Sep 17 00:00:00 2001 From: Scott Huberty Date: Wed, 19 Mar 2025 09:34:49 -0700 Subject: [PATCH 2/3] DOC: changelog --- doc/changes/devel/13159.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/devel/13159.bugfix.rst diff --git a/doc/changes/devel/13159.bugfix.rst b/doc/changes/devel/13159.bugfix.rst new file mode 100644 index 00000000000..a2cca8421d7 --- /dev/null +++ b/doc/changes/devel/13159.bugfix.rst @@ -0,0 +1 @@ +Changed `exclude=None` to `exclude="bads"` in :func:`~mne.viz.evoked.plot_evoked_joint`, because `None` was not a valid argument for this parameter. By `Scott Huberty`_. \ No newline at end of file From 0dd3297d66828ab52ec4c59a94e10e5d73d3b8bc Mon Sep 17 00:00:00 2001 From: Scott Huberty Date: Wed, 19 Mar 2025 10:17:05 -0700 Subject: [PATCH 3/3] FIX: rst syntax --- doc/changes/devel/13159.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/devel/13159.bugfix.rst b/doc/changes/devel/13159.bugfix.rst index a2cca8421d7..407c065940a 100644 --- a/doc/changes/devel/13159.bugfix.rst +++ b/doc/changes/devel/13159.bugfix.rst @@ -1 +1 @@ -Changed `exclude=None` to `exclude="bads"` in :func:`~mne.viz.evoked.plot_evoked_joint`, because `None` was not a valid argument for this parameter. By `Scott Huberty`_. \ No newline at end of file +Changed ``exclude=None`` to ``exclude="bads"`` in :func:`~mne.viz.plot_evoked_joint`, because ``None`` was not a valid argument for this parameter. By `Scott Huberty`_. \ No newline at end of file