From 67dc2a5b41c1b2eb212e37ba1eafd572875ec31c Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Thu, 16 Nov 2023 12:34:17 +0100 Subject: [PATCH] fix legacy warning --- mne_bids/tests/test_dig.py | 8 ++++---- mne_bids/tests/test_write.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mne_bids/tests/test_dig.py b/mne_bids/tests/test_dig.py index 9f37b1a76..0295ebe00 100644 --- a/mne_bids/tests/test_dig.py +++ b/mne_bids/tests/test_dig.py @@ -109,7 +109,7 @@ def test_dig_pixels(tmp_path): op.join(bids_root, "sub-01", "ses-01", bids_path.datatype), exist_ok=True ) raw = _load_raw() - raw.pick_types(eeg=True) + raw.pick(["eeg"]) raw.del_proj() raw.set_channel_types({ch: "ecog" for ch in raw.ch_names}) @@ -145,7 +145,7 @@ def test_dig_template(tmp_path): bids_path = _bids_path.copy().update(root=bids_root, datatype=datatype) for coord_frame in BIDS_STANDARD_TEMPLATE_COORDINATE_SYSTEMS: raw = _load_raw() - raw.pick_types(eeg=True) + raw.pick(["eeg"]) bids_path.update(space=coord_frame) montage = raw.get_montage() pos = montage.get_positions() @@ -251,7 +251,7 @@ def test_template_to_head(): # test all coordinate frames raw = _load_raw() raw.set_montage(None) - raw.pick_types(eeg=True) + raw.pick(["eeg"]) raw.drop_channels(raw.ch_names[3:]) montage = mne.channels.make_dig_montage( ch_pos={ @@ -365,7 +365,7 @@ def test_convert_montage(): def test_electrodes_io(tmp_path): """Ensure only electrodes end up in *_electrodes.json.""" raw = _load_raw() - raw.pick_types(eeg=True, stim=True) # we don't need meg channels + raw.pick(["eeg", "stim"]) # we don't need meg channels bids_root = tmp_path / "bids1" bids_path = _bids_path.copy().update(root=bids_root, datatype="eeg") write_raw_bids(raw=raw, bids_path=bids_path) diff --git a/mne_bids/tests/test_write.py b/mne_bids/tests/test_write.py index f329b6284..cd9c86851 100644 --- a/mne_bids/tests/test_write.py +++ b/mne_bids/tests/test_write.py @@ -570,7 +570,7 @@ def test_fif(_bids_validate, tmp_path): bids_path.update(root=bids_root) raw = _read_raw_fif(raw_fname) raw.load_data() - raw2 = raw.pick_types(meg=False, eeg=True, stim=True, eog=True, ecg=True) + raw2 = raw.pick(["eeg", "stim", "eog", "ecg"]) raw2.save(bids_root / "test-raw.fif", overwrite=True) raw2 = mne.io.Raw(op.join(bids_root, "test-raw.fif"), preload=False) events = mne.find_events(raw2) @@ -3343,7 +3343,7 @@ def test_convert_eeg_formats(dir_name, format, fname, reader, tmp_path): raw = reader(raw_fname) # drop 'misc' type channels when exporting - raw = raw.pick_types(eeg=True) + raw = raw.pick(["eeg"]) kwargs = dict( raw=raw, format=format, bids_path=bids_path, overwrite=True, verbose=False ) @@ -3379,7 +3379,7 @@ def test_convert_eeg_formats(dir_name, format, fname, reader, tmp_path): bids_output_path = write_raw_bids(**kwargs) # channel units should stay the same - raw2 = read_raw_bids(bids_output_path) + raw2 = read_raw_bids(bids_output_path, extra_params=dict(preload=True)) assert all( [ ch1["unit"] == ch2["unit"] @@ -3431,7 +3431,7 @@ def test_format_conversion_overwrite(dir_name, format, fname, reader, tmp_path): raw = reader(raw_fname) # drop 'misc' type channels when exporting - raw = raw.pick_types(eeg=True) + raw = raw.pick(["eeg"]) kwargs = dict(raw=raw, format=format, bids_path=bids_path, verbose=False) with warnings.catch_warnings():