Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evoked.plot_joint API exclude parameter docstring is inconsistent with the code #13157

Open
scott-huberty opened this issue Mar 12, 2025 · 1 comment · May be fixed by #13159
Open

evoked.plot_joint API exclude parameter docstring is inconsistent with the code #13157

scott-huberty opened this issue Mar 12, 2025 · 1 comment · May be fixed by #13159
Labels

Comments

@scott-huberty
Copy link
Contributor

scott-huberty commented Mar 12, 2025

Description of the problem

The API doc Shows that the default value for parameter exclude is 'bads', but in the description for that parameter, it says that the default is None, when In fact, None is not even a valid argument for this parameter:

exclude : None | list of str | 'bads'
   Channels names to exclude from being shown. If ``'bads'``, the
  bad channels are excluded. Defaults to ``None``.

Steps to reproduce

sample_fpath = mne.datasets.sample.data_path()
fpath = sample_fpath / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = mne.io.read_raw(fpath, preload=True).pick("eeg")

epochs = mne.make_fixed_length_epochs(raw, duration=1, preload=True)
evoked = epochs.average()
evoked.plot_joint(exclude=None) # include/exclude must be list, tuple, ndarray, or "bads". You provided type <class 'NoneType'>.

Expected results

Figure shows with no bad channels excluded.

Actual results

ValueError: include/exclude must be list, tuple, ndarray, or "bads". You provided type <class 'NoneType'>.

Additional information

Should the code be fixed to match the docstring (i.e. accept None, and make it the default), or should the mention of None simply by removed from the docstring?

@larsoner
Copy link
Member

Should the code be fixed to match the docstring (i.e. accept None, and make it the default), or should the mention of None simply by removed from the docstring?

Let's update the docstring to match the behavior

@scott-huberty scott-huberty linked a pull request Mar 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants