Skip to content

DOC: Fix apply_function shape description for Epochs (#13118)#13891

Open
bkowshik wants to merge 1 commit intomne-tools:mainfrom
bkowshik:fix/issue-13118-epochs-applyfun-docstring
Open

DOC: Fix apply_function shape description for Epochs (#13118)#13891
bkowshik wants to merge 1 commit intomne-tools:mainfrom
bkowshik:fix/issue-13118-epochs-applyfun-docstring

Conversation

@bkowshik
Copy link
Copy Markdown

@bkowshik bkowshik commented May 8, 2026

Reference issue (if any)

What does this implement/fix?

The fun parameter docstring for mne.Epochs.apply_function incorrectly stated that the array passed to the user's function when channel_wise=False has shape (len(picks), n_times). The actual shape is (n_epochs, n_channels, n_times). Adds a new fun_applyfun_epochs docdict entry alongside fun_applyfun_evoked and fun_applyfun_stc, leaving the Raw docstring (where (len(picks), n_times) is correct) untouched.

Related (out of scope): https://mne.discourse.group/t/epochs-apply-function-channel-wise-false-picks-silently-ignores-picks/11828 — separate question about whether picks should be honored when channel_wise=False on Epochs.

Documentation post the fix looks like below:

cd doc
make html-noplot
make show
image

Additional information

Have used Claude Code to understand the issue, identify the location of fix, commands to build locally for testing.

The fun parameter docstring for mne.Epochs.apply_function incorrectly stated
that the array passed to the user's function when channel_wise=False has
shape (len(picks), n_times). The actual shape is (n_epochs, n_channels, n_times).

Adds a new fun_applyfun_epochs docdict entry alongside fun_applyfun_evoked
and fun_applyfun_stc, leaving the Raw docstring (where (len(picks), n_times)
is correct) untouched. Per scott-huberty's review suggestion on mne-tools#13136.

Fixes mne-tools#13118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apply_function docstring wrong for epochs?

1 participant