Skip to content

Commit bb34f36

Browse files
authored
ENH: channel_indices_by_type now has an exclude param (#13293)
1 parent 99275fa commit bb34f36

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:func:`~mne.channel_indices_by_type` now has an ``exclude`` parameter, by `Stefan Appelhoff`_.

mne/_fiff/pick.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,13 +834,18 @@ def pick_types_forward(
834834

835835

836836
@fill_doc
837-
def channel_indices_by_type(info, picks=None):
837+
def channel_indices_by_type(info, picks=None, *, exclude=()):
838838
"""Get indices of channels by type.
839839
840840
Parameters
841841
----------
842842
%(info_not_none)s
843843
%(picks_all)s
844+
exclude : list | str
845+
Set of channels to exclude, only used when picking based on
846+
types (e.g., exclude="bads" when picks="meg").
847+
848+
.. versionadded:: 1.10.0
844849
845850
Returns
846851
-------
@@ -865,7 +870,7 @@ def channel_indices_by_type(info, picks=None):
865870
eyegaze=list(),
866871
pupil=list(),
867872
)
868-
picks = _picks_to_idx(info, picks, none="all", exclude=(), allow_empty=True)
873+
picks = _picks_to_idx(info, picks, none="all", exclude=exclude, allow_empty=True)
869874
for k in picks:
870875
ch_type = channel_type(info, k)
871876
for key in idx_by_type.keys():

0 commit comments

Comments
 (0)