@testing.requires_testing_data
def test_output_formats():
 tempdir = _TempDir()
 formats = ['short', 'int', 'single', 'double']
 tols = [0.0001, 1e-07, 1e-07, 1e-15]
 raw = read_raw_fif(test_fif_fname).crop(0, 1)
 temp_file = op.join(tempdir, 'raw.fif')
 for (ii, (fmt, tol)) in enumerate(zip(formats, tols)):
  if (ii > 0):
   assert_raises(IOError, raw.save, temp_file, fmt=fmt)
  raw.save(temp_file, fmt=fmt, overwrite=True)
  raw2 = read_raw_fif(temp_file)
  raw2_data = raw2[:, :][0]
  assert_allclose(raw2_data, raw[:, :][0], rtol=tol, atol=1e-25)
  assert_equal(raw2.orig_format, fmt)

@ testing . requires_testing_data def test_output_formats ( ) : tempdir = _TempDir ( ) formats = [ 'short' , 'int' , 'single' , 'double' ] tols = [ 0.0001 , 1e-07 , 1e-07 , 1e-15 ] raw = read_raw_fif ( test_fif_fname ) . crop ( 0 , 1 ) temp_file = op . join ( tempdir , 'raw.fif' ) for ( ii , ( fmt , tol ) ) in enumerate ( zip ( formats , tols ) ) : if ( ii > 0 ) : assert_raises ( IOError , raw . save , temp_file , fmt = fmt ) raw . save ( temp_file , fmt = fmt , overwrite = True ) raw2 = read_raw_fif ( temp_file ) raw2_data = raw2 [ : , : ] [ 0 ] assert_allclose ( raw2_data , raw [ : , : ] [ 0 ] , rtol = tol , atol = 1e-25 ) assert_equal ( raw2 . orig_format , fmt )
test saving and loading raw data using multiple formats .