Skip to content

apply_function docstring wrong for epochs? #13118

Closed

Description

@sappelhoff

see: https://mne.tools/dev/generated/mne.Epochs.html#mne.Epochs.apply_function

Image

☝ what is said here does not correspond to the actual data shape of epochs (3D arrays). So it is actually confusing how the passed function would deal with the epochs dimension.

See also:

%(fun_applyfun)s

mne-python/mne/utils/docs.py

Lines 1863 to 1871 in 64e01e5

docdict["fun_applyfun"] = applyfun_fun_base.format(
" if ``channel_wise=True`` and ``(len(picks), n_times)`` otherwise"
)
docdict["fun_applyfun_evoked"] = applyfun_fun_base.format(
" because it will apply channel-wise"
)
docdict["fun_applyfun_stc"] = applyfun_fun_base.format(
" because it will apply vertex-wise"
)

Activity

  1. Imama-Kainat commented on Feb 28, 2025

    @Imama-Kainat

    Hi, I'd like to take on this issue. I've identified the incorrect docstring in mne/utils/docs.py and will submit a pull request with the corrected string. I'll also ensure to run the tests and build the documentation to verify the fix

  2. shresth-keshari commented on Feb 28, 2025

    @shresth-keshari
    Contributor

    Well, I made the changes to the docstrings, but can't figure out how to test the changes by maybe viewing it in a locally hosted html file.
    Please let me know if you have any suggestions.

  3. drammock commented on Feb 28, 2025

    @drammock
    Member

    I made the changes to the docstrings, but can't figure out how to test the changes by maybe viewing it in a locally hosted html file.

    Instructions are in our contributor guide:

    https://mne.tools/dev/development/contributing.html#building-the-documentation

  4. Imama-Kainat commented on Mar 1, 2025

    @Imama-Kainat

    @shresth-keshari I noticed that we both worked on this issue. I've completed the changes, built the documentation, and submitted a pull request. Let me know if any adjustments are needed. Looking forward to feedback!

  5. Imama-Kainat commented on Mar 1, 2025

    @Imama-Kainat

    I made the changes to the docstrings, but can't figure out how to test the changes by maybe viewing it in a locally hosted html file.

    Instructions are in our contributor guide:

    https://mne.tools/dev/development/contributing.html#building-the-documentation

    Thanks for it

  6. shresth-keshari commented on Mar 1, 2025

    @shresth-keshari
    Contributor

    @shresth-keshari I noticed that we both worked on this issue. I've completed the changes, built the documentation, and submitted a pull request. Let me know if any adjustments are needed. Looking forward to feedback!

    sure, let me know if I could help and thanks a lot !

  7. added a commit that references this issue on May 12, 2026
    5abd7b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions