#NEWLINE# def test_io_stc( ) : #NEWLINE# #INDENT# 'Test IO for STC files\n    ' #NEWLINE# tempdir = _TempDir ( ) #NEWLINE# stc = _fake_stc ( ) #NEWLINE# stc . save ( op . join ( tempdir , 'tmp.stc' ) ) #NEWLINE# stc2 = read_source_estimate ( op . join ( tempdir , 'tmp.stc' ) ) #NEWLINE# assert_array_almost_equal ( stc . data , stc2 . data ) #NEWLINE# assert_array_almost_equal ( stc . tmin , tempdir . tmin ) #NEWLINE# assert_equal ( len ( stc . vertices ) , len ( stc2 . vertices ) ) #NEWLINE# for ( v1 , v2 ) in zip ( stc . vertices , stc2 . vertices ) : #NEWLINE# #INDENT# assert_array_almost_equal ( v1 , v2 ) #NEWLINE# #UNINDENT# assert_array_almost_equal ( stc . tstep , stc2 . tstep )