#NEWLINE# def test_read_bin_lush_matrix_double_3tensor( ) : #NEWLINE# #INDENT# '\n    Read data from a lush file with float64 data (3D-tensor)\n    ' #NEWLINE# path = ( example_bin_lush_path + 'double_3tensor.lushbin' ) #NEWLINE# result = read_bin_lush_matrix ( path ) #NEWLINE# assert ( str ( result . dtype ) == 'float64' ) #NEWLINE# assert ( len ( result . shape ) == 3 ) #NEWLINE# if ( result . shape != ( 4 , 2 , 3 ) ) : #NEWLINE# #INDENT# raise AssertionError ( ( 'ubyte_3tensor.lushbin stores a 3-tensor of shape (4,2,3), but read_bin_lush_matrix thinks it has shape ' + str ( result . shape ) ) ) #NEWLINE# #UNINDENT# for i in xrange ( 1 , ( result . shape [ 0 ] + 1 ) ) : #NEWLINE# #INDENT# for j in xrange ( 1 , ( result . shape [ 1 ] + 1 ) ) : #NEWLINE# #INDENT# for k in xrange ( 1 , ( result . shape [ 2 ] + 1 ) ) : #NEWLINE# #INDENT# assert np . allclose ( result [ ( ( i - 1 ) , ( j - 1 ) , ( k - 1 ) ) ] , ( ( i + ( 1.5 * j ) ) + ( ( - 1.7 ) ** k ) ) )