@testing.requires_testing_data
def test_io_bem():
 tempdir = _TempDir()
 temp_bem = op.join(tempdir, 'temp-bem.fif')
 assert_raises(ValueError, read_bem_surfaces, fname_raw)
 assert_raises(ValueError, read_bem_surfaces, fname_bem_3, s_id=10)
 surf = read_bem_surfaces(fname_bem_3, patch_stats=True)
 surf = read_bem_surfaces(fname_bem_3, patch_stats=False)
 write_bem_surfaces(temp_bem, surf[0])
 surf_read = read_bem_surfaces(temp_bem, patch_stats=False)
 _compare_bem_surfaces(surf, surf_read)
 assert_raises(RuntimeError, read_bem_solution, fname_bem_3)
 temp_sol = op.join(tempdir, 'temp-sol.fif')
 sol = read_bem_solution(fname_bem_sol_3)
 assert_true(('BEM' in repr(sol)))
 write_bem_solution(temp_sol, sol)
 sol_read = read_bem_solution(temp_sol)
 _compare_bem_solutions(sol, sol_read)
 sol = read_bem_solution(fname_bem_sol_1)
 assert_raises(RuntimeError, _bem_find_surface, sol, 3)

@ testing . requires_testing_data def test_io_bem ( ) : tempdir = _TempDir ( ) temp_bem = op . join ( tempdir , 'temp-bem.fif' ) assert_raises ( ValueError , read_bem_surfaces , fname_raw ) assert_raises ( ValueError , read_bem_surfaces , fname_bem_3 , s_id = 10 ) surf = read_bem_surfaces ( fname_bem_3 , patch_stats = True ) surf = read_bem_surfaces ( fname_bem_3 , patch_stats = False ) write_bem_surfaces ( temp_bem , surf [ 0 ] ) surf_read = read_bem_surfaces ( temp_bem , patch_stats = False ) _compare_bem_surfaces ( surf , surf_read ) assert_raises ( RuntimeError , read_bem_solution , fname_bem_3 ) temp_sol = op . join ( tempdir , 'temp-sol.fif' ) sol = read_bem_solution ( fname_bem_sol_3 ) assert_true ( ( 'BEM' in repr ( sol ) ) ) write_bem_solution ( temp_sol , sol ) sol_read = read_bem_solution ( temp_sol ) _compare_bem_solutions ( sol , sol_read ) sol = read_bem_solution ( fname_bem_sol_1 ) assert_raises ( RuntimeError , _bem_find_surface , sol , 3 )
test reading and writing of bem surfaces and solutions .