@@ -61,8 +61,9 @@ def test_geometry():
61
61
assert 0 == faces .min ()
62
62
assert coords .shape [0 ] == (faces .max () + 1 )
63
63
assert 9 == len (volume_info )
64
- assert [2 , 0 , 20 ] == volume_info ['head' ]
65
- assert ['created by greve on Thu Jun 8 19:17:51 2006' ] == create_stamp
64
+ # assert np.array_equal([2, 0, 20],volume_info['head'])
65
+ np .testing .assert_array_equal ([2 , 0 , 20 ],volume_info ['head' ])
66
+ assert create_stamp == ['created by greve on Thu Jun 8 19:17:51 2006' ] # this creates assertion error - should we just remove it?
66
67
67
68
# Test equivalence of freesurfer- and nibabel-generated triangular files
68
69
# with respect to read_geometry()
@@ -79,7 +80,8 @@ def test_geometry():
79
80
for key in ('xras' , 'yras' , 'zras' , 'cras' ):
80
81
assert_allclose (volume_info2 [key ], volume_info [key ],
81
82
rtol = 1e-7 , atol = 1e-30 )
82
- assert volume_info2 ['cras' ] == volume_info ['cras' ]
83
+ #assert.array_equal(volume_info2['cras'], volume_info['cras'])
84
+ np .testing .assert_array_equal (volume_info2 ['cras' ], volume_info ['cras' ])
83
85
with open (surf_path , 'rb' ) as fobj :
84
86
np .fromfile (fobj , ">u1" , 3 )
85
87
read_create_stamp = fobj .readline ().decode ().rstrip ('\n ' )
@@ -126,8 +128,8 @@ def test_quad_geometry():
126
128
new_path = 'test'
127
129
write_geometry (new_path , coords , faces )
128
130
coords2 , faces2 = read_geometry (new_path )
129
- assert coords == coords2
130
- assert faces == faces2
131
+ assert np . array_equal ( coords , coords2 )
132
+ assert np . array_equal ( faces , faces2 )
131
133
132
134
133
135
@freesurfer_test
@@ -141,7 +143,7 @@ def test_morph_data():
141
143
new_path = 'test'
142
144
write_morph_data (new_path , curv )
143
145
curv2 = read_morph_data (new_path )
144
- assert curv2 == curv
146
+ assert np . array_equal ( curv2 , curv )
145
147
146
148
147
149
def test_write_morph_data ():
@@ -154,7 +156,7 @@ def test_write_morph_data():
154
156
for shape in okay_shapes :
155
157
write_morph_data ('test.curv' , values .reshape (shape ))
156
158
# Check ordering is preserved, regardless of shape
157
- assert values == read_morph_data ('test.curv' )
159
+ assert np . array_equal ( read_morph_data ('test.curv' ) , values )
158
160
with pytest .raises (ValueError ):
159
161
write_morph_data ('test.curv' , np .zeros (shape ), big_num )
160
162
# Windows 32-bit overflows Python int
0 commit comments