Skip to content

Conversation

NatalieNegussie97
Copy link

Add See Also section with references to related methods:

  • add_proj, del_proj
  • set_channel_types, set_meas_date
    This addresses issue DOC: add crossrefs in the info docstring #7774 by adding crossrefs to the 'rename_channels' docstring as requested. The See Also section now includes references to related methods that users might want to use alongside 'rename_channels'.

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the diff shows over 3700 lines changed (the entire file). I'm guessing your text editor or IDE did some kind of auto-replacement of spaces/tabs or line endings. Please check

git config --get core.autocrlf

If you're on windows, it should say true; if not then change it:

# run within the folder of your MNE-Python clone
git config core.autocrlf true

If you're on Linux or Mac, it should be input; if not, change it:

git config core.autocrlf input

you can optionally add a --global flag to set it for all projects on your computer.

If that already looked correct, then check your IDE's settings, it might be doing some autocorrection too. Ping us when the diff view of this PR shows only the changes you intended.

@NatalieNegussie97 NatalieNegussie97 force-pushed the add-info-docstring-crossrefs branch from bf7dd2b to aca182e Compare August 21, 2025 20:59
@NatalieNegussie97
Copy link
Author

fixed

@drammock
Copy link
Member

Thanks for fixing the line endings! Some feedback:

  • You've added the crossrefs here (to the See Also section of mne.Info.rename_channels). The intent was to add the crossrefs to the See Also section of mne.Info itself (here).

  • The crossrefs should probably be grouped by function, rather than by object type. For example:

    Add projectors: mne.io.Raw.add_proj, mne.Epochs.add_proj, mne.Evoked.add_proj

    Rename channels: mne.io.Raw.rename_channels, mne.Epochs.rename_channels, mne.Evoked.rename_channels, mne.Info.rename_channels

    ... etc. Hopefully that won't look too messy / be too hard to read. If it does, we can think about alternatives (formatting as a list, putting it in Notes instead of See Also, ...)

  • We should probably also add to the end of this warning something like "Check the See Also section for a list of functions/methods that safely modify Info's read-only fields."

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.

2 participants