@testing.requires_testing_data
def test_read_write_head_pos():
 tempdir = _TempDir()
 temp_name = op.join(tempdir, 'temp.pos')
 head_pos_rand = np.random.RandomState(0).randn(20, 10)
 head_pos_read = read_head_pos(pos_fname)
 for head_pos_orig in (head_pos_rand, head_pos_read):
  write_head_pos(temp_name, head_pos_orig)
  head_pos = read_head_pos(temp_name)
  assert_allclose(head_pos_orig, head_pos, atol=0.001)
 assert_raises(TypeError, write_head_pos, 0, head_pos_read)
 assert_raises(ValueError, write_head_pos, temp_name, 'foo')
 assert_raises(ValueError, write_head_pos, temp_name, head_pos_read[:, :9])
 assert_raises(TypeError, read_head_pos, 0)
 assert_raises(IOError, read_head_pos, (temp_name + 'foo'))

@ testing . requires_testing_data def test_read_write_head_pos ( ) : tempdir = _TempDir ( ) temp_name = op . join ( tempdir , 'temp.pos' ) head_pos_rand = np . random . RandomState ( 0 ) . randn ( 20 , 10 ) head_pos_read = read_head_pos ( pos_fname ) for head_pos_orig in ( head_pos_rand , head_pos_read ) : write_head_pos ( temp_name , head_pos_orig ) head_pos = read_head_pos ( temp_name ) assert_allclose ( head_pos_orig , head_pos , atol = 0.001 ) assert_raises ( TypeError , write_head_pos , 0 , head_pos_read ) assert_raises ( ValueError , write_head_pos , temp_name , 'foo' ) assert_raises ( ValueError , write_head_pos , temp_name , head_pos_read [ : , : 9 ] ) assert_raises ( TypeError , read_head_pos , 0 ) assert_raises ( IOError , read_head_pos , ( temp_name + 'foo' ) )
test reading and writing head position quaternion parameters .