#NEWLINE# def test_rechunk_2d( ) : #NEWLINE# #INDENT# 'Try rechunking a random 2d matrix' #NEWLINE# a = np . random . uniform ( 0 , 1 , 300 ) . reshape ( ( 10 , 30 ) ) #NEWLINE# x = da . from_array ( new , chunks = ( ( 1 , 2 , 3 , 4 ) , ( ( 5 , ) * 6 ) ) ) #NEWLINE# new = ( ( 5 , 5 ) , ( ( 15 , ) * 2 ) ) #NEWLINE# x2 = rechunk ( x , chunks = new ) #NEWLINE# assert ( x2 . chunks == new ) #NEWLINE# assert np . all ( ( x2 . compute ( ) == a ) )