Skip to content

Channel adjacency improvements #12292

Open

Description

@mscheltienne

Proposed documentation enhancement

The docstring of the picks argument in read_ch_adjacency is wrong as there is no info provided to this function.

Also, find_ch_adjacency could benefit from an extra argument similar to pick in read_ch_adjacency to select channels to include in the adjacency matrix. I see 2 options forward:

  • (1) Keep ch_type and add exclude=() which can be set to exclude="bads"
  • (2) Deprecate ch_type in favor of the traditional picks argument, with an adapted docstring mentioning that the channel selection provided must yield a single channel type (+ check and appropriate error message)

I'm in favor of (2) as it offers more flexibility to find_ch_adjacency.

Correspond to this forum post: https://mne.discourse.group/t/find-ch-adjacency-not-accounting-for-bad-channels/7968/

Activity

  1. larsoner commented on Dec 12, 2023

    @larsoner
    Member

    Given ch_type is in second position and we easily can do something like:

    def find_ch_adjacency(info, picks, *, ch_type=None):
        if ch_type is not None:
            warn(...)
            picks = ch_type
    

    that will avoid breaking code for some folks, I'm in favor of (2)

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