@requires_sklearn
def test_ica_reject_buffer():
 raw = read_raw_fif(raw_fname).crop(1.5, stop).load_data()
 picks = pick_types(raw.info, meg=True, stim=False, ecg=False, eog=False, exclude='bads')
 ica = ICA(n_components=3, max_pca_components=4, n_pca_components=4)
 raw._data[2, 1000:1005] = 5e-12
 with catch_logging() as drop_log:
  with warnings.catch_warnings(record=True):
   ica.fit(raw, picks[:5], reject=dict(mag=2.5e-12), decim=2, tstep=0.01, verbose=True)
  assert_true(((raw._data[:5, ::2].shape[1] - 4) == ica.n_samples_))
 log = [l for l in drop_log.getvalue().split('\n') if ('detected' in l)]
 assert_equal(len(log), 1)

@ requires_sklearn def test_ica_reject_buffer ( ) : raw = read_raw_fif ( raw_fname ) . crop ( 1.5 , stop ) . load_data ( ) picks = pick_types ( raw . info , meg = True , stim = False , ecg = False , eog = False , exclude = 'bads' ) ica = ICA ( n_components = 3 , max_pca_components = 4 , n_pca_components = 4 ) raw . _data [ 2 , 1000 : 1005 ] = 5e-12 with catch_logging ( ) as drop_log : with warnings . catch_warnings ( record = True ) : ica . fit ( raw , picks [ : 5 ] , reject = dict ( mag = 2.5e-12 ) , decim = 2 , tstep = 0.01 , verbose = True ) assert_true ( ( ( raw . _data [ : 5 , : : 2 ] . shape [ 1 ] - 4 ) == ica . n_samples_ ) ) log = [ l for l in drop_log . getvalue ( ) . split ( '\n' ) if ( 'detected' in l ) ] assert_equal ( len ( log ) , 1 )
test ica data raw buffer rejection .