def test_auto_scale():
 raw = read_raw_fif(raw_fname)
 epochs = Epochs(raw, read_events(ev_fname))
 rand_data = np.random.randn(10, 100)
 for inst in [raw, epochs]:
  scale_grad = 10000000000.0
  scalings_def = dict([('eeg', 'auto'), ('grad', scale_grad), ('stim', 'auto')])
  assert_raises(ValueError, inst.plot, scalings='foo')
  assert_raises(ValueError, _compute_scalings, 'foo', inst)
  scalings_new = _compute_scalings(scalings_def, inst)
  assert_true((scale_grad == scalings_new['grad']))
  assert_true((scalings_new['eeg'] != 'auto'))
 assert_raises(ValueError, _compute_scalings, scalings_def, rand_data)
 epochs = epochs[0].load_data()
 epochs.pick_types(eeg=True, meg=False)
 assert_raises(ValueError, _compute_scalings, dict(grad='auto'), epochs)

def test_auto_scale ( ) : raw = read_raw_fif ( raw_fname ) epochs = Epochs ( raw , read_events ( ev_fname ) ) rand_data = np . random . randn ( 10 , 100 ) for inst in [ raw , epochs ] : scale_grad = 10000000000.0 scalings_def = dict ( [ ( 'eeg' , 'auto' ) , ( 'grad' , scale_grad ) , ( 'stim' , 'auto' ) ] ) assert_raises ( ValueError , inst . plot , scalings = 'foo' ) assert_raises ( ValueError , _compute_scalings , 'foo' , inst ) scalings_new = _compute_scalings ( scalings_def , inst ) assert_true ( ( scale_grad == scalings_new [ 'grad' ] ) ) assert_true ( ( scalings_new [ 'eeg' ] != 'auto' ) ) assert_raises ( ValueError , _compute_scalings , scalings_def , rand_data ) epochs = epochs [ 0 ] . load_data ( ) epochs . pick_types ( eeg = True , meg = False ) assert_raises ( ValueError , _compute_scalings , dict ( grad = 'auto' ) , epochs )
test auto-scaling of channels for quick plotting .