Skip to content

Commit

Permalink
fix doc and logging mark_channels
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Aug 16, 2024
1 parent 648867f commit c0b66a2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -2463,9 +2463,8 @@ def mark_channels(bids_path, *, ch_names, status, descriptions=None, verbose=Non
The names of the channel(s) to mark with a ``status`` and possibly a
``description``. Can be an empty list to indicate all channel names.
status : 'good' | 'bad' | list of str
The status of the channels ('good', or 'bad'). Default is 'bad'. If it
is a list, then must be a list of 'good', or 'bad' that has the same
length as ``ch_names``.
The status of the channels ('good', or 'bad'). If it is a list, then must be a
list of 'good', or 'bad' that has the same length as ``ch_names``.
descriptions : None | str | list of str
Descriptions of the reasons that lead to the exclusion of the
channel(s). If a list, it must match the length of ``ch_names``.
Expand Down Expand Up @@ -2543,7 +2542,7 @@ def mark_channels(bids_path, *, ch_names, status, descriptions=None, verbose=Non
f"({len(ch_names)})."
)

if not all(status in ["good", "bad"] for status in status):
if not all(status_ in ["good", "bad"] for status_ in status):
raise ValueError(
'Setting the status of a channel must only be "good", or "bad".'
)
Expand All @@ -2565,7 +2564,7 @@ def mark_channels(bids_path, *, ch_names, status, descriptions=None, verbose=Non
idx = tsv_data["name"].index(ch_name)
logger.info(
f"Processing channel {ch_name}:\n"
f" status: bad\n"
f" status: {status_}\n"
f" description: {description}"
)
tsv_data["status"][idx] = status_
Expand Down

0 comments on commit c0b66a2

Please sign in to comment.