#NEWLINE# def test_rechunk_blockshape( ) : #NEWLINE# #INDENT# ' Test that blockshape can be used.' #NEWLINE# ( new_shape , new_chunks ) = ( ( 10 , 10 ) , ( 4 , 3 ) ) #NEWLINE# new_blockdims = normalize_chunks ( new_chunks , new_shape ) #NEWLINE# old_chunks = ( ( 4 , 4 , 2 ) , ( 3 , 3 , 3 , 1 ) ) #NEWLINE# a = np . random . uniform ( 0 , 1 , 100 ) . reshape ( ( 10 , 10 ) ) #NEWLINE# x = da . from_array ( a , chunks = old_chunks ) #NEWLINE# check1 = rechunk ( x , chunks = new_chunks ) #NEWLINE# assert ( check1 . chunks == new_blockdims ) #NEWLINE# assert np . all ( ( check1 . compute ( ) == a ) )