Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG: Remove deprecated mark_bad_channels() #1009

Merged
merged 4 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ Detailed list of changes
🚀 Enhancements
^^^^^^^^^^^^^^^

- You can now write raw data and an associated empty-room recording with just a single call to :func:`mne_bids.write_raw_bids`: the ``empty_room`` parameter now also accepts a :class:`mne.io.Raw` data object. The empty-room session name will be derived from the recording date automatically, by `Richard Höchenberger`_ (:gh:`xxx`)
- You can now write raw data and an associated empty-room recording with just a single call to :func:`mne_bids.write_raw_bids`: the ``empty_room`` parameter now also accepts an :class:`mne.io.Raw` data object. The empty-room session name will be derived from the recording date automatically, by `Richard Höchenberger`_ (:gh:`998`)

🧐 API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- :func:`mne_bids.make_dataset_description` now accepts keyword arguments only, and can now also write the following metadata: ``HEDVersion``, ``EthicsApprovals``, ``GeneratedBy``, and ``SourceDatasets``, by `Stefan Appelhoff`_ (:gh:`406`)

- The deprecated function ```mne_bids.mark_bad_channels`` has been removed in favor of :func:`mne_bids.mark_channels`, by `Richard Höchenberger`_ (:gh:`1009`)

🛠 Requirements
^^^^^^^^^^^^^^^

Expand All @@ -64,7 +66,7 @@ Detailed list of changes

- The MNE-BIDS Inspector didn't work if ``mne-qt-browser`` was installed and used as the default plotting backend, as the Inspector currently only supports the Matplotlib backend, by `Richard Höchenberger`_ (:gh:`1007`)

- :func:`mne.copyfiles.copyfile_brainvision` can now deal with ``.dat`` file extension, by `Dominik Welke`_ (:gh:`1008`)
- :func:`~mne_bids.copyfiles.copyfile_brainvision` can now deal with ``.dat`` file extension, by `Dominik Welke`_ (:gh:`1008`)

:doc:`Find out what was new in previous releases <whats_new_previous_releases>`

Expand Down
45 changes: 1 addition & 44 deletions mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from mne.channels.channels import _unit2human
from mne.utils import (check_version, has_nibabel, logger, warn, Bunch,
_validate_type, get_subjects_dir, verbose,
deprecated, ProgressBar)
ProgressBar)
import mne.preprocessing

from mne_bids.pick import coil_type
Expand Down Expand Up @@ -2166,49 +2166,6 @@ def write_anat(image, bids_path, landmarks=None, deface=False, overwrite=False,
return bids_path


@deprecated(extra='mark_bad_channels is deprecated in favor of mark_channels '
'and will be removed in v0.10.')
@verbose
def mark_bad_channels(ch_names, descriptions=None, *, bids_path,
overwrite=False, verbose=None):
"""Update which channels are marked as "bad" in an existing BIDS dataset.

This modifies entries in the ``channels.tsv`` file in a BIDS dataset.

Parameters
----------
ch_names : str | list of str
The names of the channel(s) to mark as bad. Pass an empty list in
combination with ``overwrite=True`` to mark all channels as good.
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``.
If ``None``, no descriptions are added.
bids_path : BIDSPath
The recording to update. The :class:`mne_bids.BIDSPath` instance passed
here **must** have the ``.root`` attribute set. The ``.datatype``
attribute **may** be set. If ``.datatype`` is not set and only one data
type (e.g., only EEG or MEG data) is present in the dataset, it will be
selected automatically.
overwrite : bool
If ``False``, only update the information of the channels passed via
``ch_names``, and leave the rest untouched. If ``True``, update the
information of **all** channels: mark the channels passed via
``ch_names`` as bad, and all remaining channels as good, also
discarding their descriptions.
%(verbose)s
"""
# if overwrite, first mark all channels as good and overwrite
# their descriptions
if overwrite:
mark_channels(bids_path=bids_path, ch_names=[], status='good',
descriptions='n/a', verbose=verbose)

# now mark the channels that we want as bad
mark_channels(bids_path=bids_path, ch_names=ch_names, status='bad',
descriptions=descriptions, verbose=verbose)


@verbose
def mark_channels(bids_path, *, ch_names, status, descriptions=None,
verbose=None):
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ filterwarnings =
ignore:numpy.ufunc size changed.*:RuntimeWarning
ignore:tostring\(\) is deprecated.*:DeprecationWarning
ignore:MEG ref channel RMSP did not.*:RuntimeWarning
# These can be deleted in v0.10.
ignore:Function mark_bad_channels is deprecated.*:DeprecationWarning
# This is for Python 3.10+ and MNE <1.0
ignore:The distutils package is deprecated.*:DeprecationWarning
# Python 3.10+ and NumPy 1.22 (and maybe also newer NumPy versions?)
Expand Down