mne-tools / mne-tools/mne-python

`.get_data()`'s `picks` docstring does not explicitly state that bad channels are included by default

Open
#12,197 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DOC EASY
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Proposed documentation enhancement

Currently, the doctoring for the picks parameter of .get_data() reads:

picksstr | array_like | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all channels. Note that channels in info['bads'] will be included if their names or indices are explicitly provided.

See e.g. https://mne.tools/dev/generated/mne.Epochs.html#mne.Epochs.get_data

I always assumed that bad channels are not included by default (None), as I didn't provide their names or indices. But that doesn't seem to be the case.

The doctoring should be updated to explicitly state that by default, bads will be included.

This also suggests that we should take a look at our tutorials that make use of .get_data() and update them to pass picks="data" or similar.

We may also need to take a look at the decoding steps of MNE-BIDS-Pipeline, which use .get_data(), too.

Edit: In most (all?) tutorials we run inst.pick(..., exclude="bads"), which avoids the issue mentioned above.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the .get_data() API documentation, including the linked Epochs.get_data entry point. Update the picks description to make the default handling of bad channels explicit, then review the tutorials mentioned in the issue and determine whether any should pass picks="data" or similar. Check whether the noted MNE-BIDS-Pipeline decoding uses also need review.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.