Exemplo n.º 1
0
 def test_valid_index_3d(self):
     block_arr = BlockArray(shape=(16, 16, 16))
     assert block_arr.valid_index(0, 0, 0)
     assert block_arr.valid_index(8, 7, 4)
     assert block_arr.valid_index(15, 15, 15)
     assert block_arr.valid_index(1, 1, 1, pad=1)
     assert block_arr.valid_index(14, 14, 14, pad=1)
Exemplo n.º 2
0
 def test_invalid_index_2d(self):
     block_arr = BlockArray(shape=(16, 16))
     assert not block_arr.valid_index(5)
     assert not block_arr.valid_index(5, 5, 5)
     assert not block_arr.valid_index(-1, -1)
     assert not block_arr.valid_index(16, 16)
     assert not block_arr.valid_index(0, 0, pad=1)
     assert not block_arr.valid_index(15, 15, pad=1)