Skip to content

Commit

Permalink
fix legacy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Nov 16, 2023
1 parent 47170ca commit 67dc2a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions mne_bids/tests/test_dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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={
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 67dc2a5

Please sign in to comment.