def test_intersect_1():
 old = ((10, 10, 10, 10, 10),)
 new = ((25, 5, 20),)
 answer = [(((0, slice(0, 10)),), ((1, slice(0, 10)),), ((2, slice(0, 5)),)), (((2, slice(5, 10)),),), (((3, slice(0, 10)),), ((4, slice(0, 10)),))]
 cross = list(intersect_chunks(old_chunks=old, new_chunks=new))
 assert (answer == cross)

def test_intersect_1 ( ) : old = ( ( 10 , 10 , 10 , 10 , 10 ) , ) new = ( ( 25 , 5 , 20 ) , ) answer = [ ( ( ( 0 , slice ( 0 , 10 ) ) , ) , ( ( 1 , slice ( 0 , 10 ) ) , ) , ( ( 2 , slice ( 0 , 5 ) ) , ) ) , ( ( ( 2 , slice ( 5 , 10 ) ) , ) , ) , ( ( ( 3 , slice ( 0 , 10 ) ) , ) , ( ( 4 , slice ( 0 , 10 ) ) , ) ) ] cross = list ( intersect_chunks ( old_chunks = old , new_chunks = new ) ) assert ( answer == cross )
convert 1 d chunks .