Exemple #1
0
 def test_valid_index_3d(self):
     row_arr = RowMajorArray(shape=(16, 16, 16))
     assert row_arr.valid_index(0, 0, 0)
     assert row_arr.valid_index(8, 7, 4)
     assert row_arr.valid_index(15, 15, 15)
     assert row_arr.valid_index(1, 1, 1, pad=1)
     assert row_arr.valid_index(14, 14, 14, pad=1)
Exemple #2
0
 def test_invalid_index_2d(self):
     row_arr = RowMajorArray(shape=(16, 16))
     assert not row_arr.valid_index(5)
     assert not row_arr.valid_index(5, 5, 5)
     assert not row_arr.valid_index(-1, -1)
     assert not row_arr.valid_index(16, 16)
     assert not row_arr.valid_index(0, 0, pad=1)
     assert not row_arr.valid_index(15, 15, pad=1)