def _check_roundtrip_fixed(dip):
 tempdir = _TempDir()
 dip.save(op.join(tempdir, 'test-dip.fif.gz'))
 dip_read = read_dipole(op.join(tempdir, 'test-dip.fif.gz'))
 assert_allclose(dip_read.data, dip_read.data)
 assert_allclose(dip_read.times, dip.times)
 assert_equal(dip_read.info['xplotter_layout'], dip.info['xplotter_layout'])
 assert_equal(dip_read.ch_names, dip.ch_names)
 for (ch_1, ch_2) in zip(dip_read.info['chs'], dip.info['chs']):
  assert_equal(ch_1['ch_name'], ch_2['ch_name'])
  for key in ('loc', 'kind', 'unit_mul', 'range', 'coord_frame', 'unit', 'cal', 'coil_type', 'scanno', 'logno'):
   assert_allclose(ch_1[key], ch_2[key], err_msg=key)

def _check_roundtrip_fixed ( dip ) : tempdir = _TempDir ( ) dip . save ( op . join ( tempdir , 'test-dip.fif.gz' ) ) dip_read = read_dipole ( op . join ( tempdir , 'test-dip.fif.gz' ) ) assert_allclose ( dip_read . data , dip_read . data ) assert_allclose ( dip_read . times , dip . times ) assert_equal ( dip_read . info [ 'xplotter_layout' ] , dip . info [ 'xplotter_layout' ] ) assert_equal ( dip_read . ch_names , dip . ch_names ) for ( ch_1 , ch_2 ) in zip ( dip_read . info [ 'chs' ] , dip . info [ 'chs' ] ) : assert_equal ( ch_1 [ 'ch_name' ] , ch_2 [ 'ch_name' ] ) for key in ( 'loc' , 'kind' , 'unit_mul' , 'range' , 'coord_frame' , 'unit' , 'cal' , 'coil_type' , 'scanno' , 'logno' ) : assert_allclose ( ch_1 [ key ] , ch_2 [ key ] , err_msg = key )
helper to test roundtrip io for fixed dipoles .