Skip to content

Commit

Permalink
TST add test for interpolate_bads
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Sep 17, 2018
1 parent ca0cebd commit f76b7ab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions autoreject/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,20 @@ def test_utils():
_interpolate_bads_eeg(evoked_ar, picks=None)
mne.channels.interpolation._interpolate_bads_eeg(evoked_mne)
assert_array_equal(evoked_ar.data, evoked_mne.data)


def test_interpolate_bads():
"""Test interpolate bads"""
event_id = None
events = mne.find_events(raw)
tmin, tmax = -0.2, 0.5
for ii, ch_name in enumerate(raw.info['ch_names'][:14]):
raw.set_channel_types({ch_name: 'bio'})
raw.rename_channels({ch_name: 'BIO%02d' % ii})

picks = mne.pick_types(raw.info, meg='grad', eeg=False, eog=False)
epochs = mne.Epochs(raw, events, event_id, tmin, tmax,
baseline=(None, 0), decim=10,
reject=None, preload=True)[:10]
epochs.info['bads'] = ['MEG 2212']
interpolate_bads(epochs, picks)

0 comments on commit f76b7ab

Please sign in to comment.