def test_comparision_with_c():
 (raw, events) = _get_data()[:2]
 c_evoked = read_evokeds(evoked_nf_name, condition=0)
 epochs = Epochs(raw, events, event_id, tmin, tmax, baseline=None, preload=True, proj=False)
 evoked = epochs.set_eeg_reference().apply_proj().average()
 sel = pick_channels(c_evoked.ch_names, evoked.ch_names)
 evoked_data = evoked.data
 c_evoked_data = c_evoked.data[sel]
 assert_true((evoked.nave == c_evoked.nave))
 assert_array_almost_equal(evoked_data, c_evoked_data, 10)
 assert_array_almost_equal(evoked.times, c_evoked.times, 12)

def test_comparision_with_c ( ) : ( raw , events ) = _get_data ( ) [ : 2 ] c_evoked = read_evokeds ( evoked_nf_name , condition = 0 ) epochs = Epochs ( raw , events , event_id , tmin , tmax , baseline = None , preload = True , proj = False ) evoked = epochs . set_eeg_reference ( ) . apply_proj ( ) . average ( ) sel = pick_channels ( c_evoked . ch_names , evoked . ch_names ) evoked_data = evoked . data c_evoked_data = c_evoked . data [ sel ] assert_true ( ( evoked . nave == c_evoked . nave ) ) assert_array_almost_equal ( evoked_data , c_evoked_data , 10 ) assert_array_almost_equal ( evoked . times , c_evoked . times , 12 )
test of average obtained vs c code .