Skip to content

Commit 93fc229

Browse files
committed
DOC: Fix apply_function shape description for Epochs
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 #13136. Fixes #13118
1 parent 893b784 commit 93fc229

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

mne/epochs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ def apply_function(
19741974
19751975
Parameters
19761976
----------
1977-
%(fun_applyfun)s
1977+
%(fun_applyfun_epochs)s
19781978
%(picks_all_data_noref)s
19791979
%(dtype_applyfun)s
19801980
%(n_jobs)s Ignored if ``channel_wise=False`` as the workload

mne/utils/docs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,9 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
19191919
docdict["fun_applyfun"] = applyfun_fun_base.format(
19201920
" if ``channel_wise=True`` and ``(len(picks), n_times)`` otherwise"
19211921
)
1922+
docdict["fun_applyfun_epochs"] = applyfun_fun_base.format(
1923+
" if ``channel_wise=True`` and ``(n_epochs, n_channels, n_times)`` otherwise"
1924+
)
19221925
docdict["fun_applyfun_evoked"] = applyfun_fun_base.format(
19231926
" because it will apply channel-wise"
19241927
)

0 commit comments

Comments
 (0)