def test_psdestimator():
 raw = io.read_raw_fif(raw_fname)
 events = read_events(event_name)
 picks = pick_types(raw.info, meg=True, stim=False, ecg=False, eog=False, exclude='bads')
 picks = picks[1:13:3]
 epochs = Epochs(raw, events, event_id, tmin, tmax, picks=picks, baseline=(None, 0), preload=True)
 epochs_data = epochs.get_data()
 psd = PSDEstimator((2 * np.pi), 0, np.inf)
 y = epochs.events[:, (-1)]
 X = psd.fit_transform(epochs_data, y)
 assert_true((X.shape[0] == epochs_data.shape[0]))
 assert_array_equal(psd.fit(epochs_data, y).transform(epochs_data), X)
 assert_raises(ValueError, psd.fit, epochs, y)
 assert_raises(ValueError, psd.transform, epochs, y)

def test_psdestimator ( ) : raw = io . read_raw_fif ( raw_fname ) events = read_events ( event_name ) picks = pick_types ( raw . info , meg = True , stim = False , ecg = False , eog = False , exclude = 'bads' ) picks = picks [ 1 : 13 : 3 ] epochs = Epochs ( raw , events , event_id , tmin , tmax , picks = picks , baseline = ( None , 0 ) , preload = True ) epochs_data = epochs . get_data ( ) psd = PSDEstimator ( ( 2 * np . pi ) , 0 , np . inf ) y = epochs . events [ : , ( - 1 ) ] X = psd . fit_transform ( epochs_data , y ) assert_true ( ( X . shape [ 0 ] == epochs_data . shape [ 0 ] ) ) assert_array_equal ( psd . fit ( epochs_data , y ) . transform ( epochs_data ) , X ) assert_raises ( ValueError , psd . fit , epochs , y ) assert_raises ( ValueError , psd . transform , epochs , y )
test methods of psdestimator .