Skip to content
Snippets Groups Projects
Commit bb506781 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Use np.isclose in tests.

parent d7ae9f60
No related branches found
No related tags found
No related merge requests found
...@@ -203,8 +203,8 @@ if __name__ == '__main__': ...@@ -203,8 +203,8 @@ if __name__ == '__main__':
for j, buf in enumerate(buftab[i]): for j, buf in enumerate(buftab[i]):
res[:, 4 + i * (difbuff_no + 1) + j + 1] = buf.vector res[:, 4 + i * (difbuff_no + 1) + j + 1] = buf.vector
header += ' difshell_' + str(i) + '_difbuff_' + str(j) header += ' difshell_' + str(i) + '_difbuff_' + str(j)
assert np.isclose(res.mean(), 0.6059903892218336), \ assert np.isclose(res.mean(), 0.60599), \
'Expected 0.6059903892218336, got %g' % np.mean(res) 'Expected 0.60599, got %g' % np.mean(res)
assert np.std(res) == 1.9505369046640817, np.std( res ), \ assert np.std(res) == 1.9505, np.std( res ), \
'Expected 1.9505369046640817 got %g' % np.std(res) 'Expected 1.95053 got %g' % np.std(res)
print( 'All done' ) print( 'All done' )
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment