Esempio n. 1
0
 def test_all_cases(self):
     array = biggus.ConstantArray((4, 3, 5), dtype=np.float32)
     # Chunk size set to fit in two items from the second dimension into a
     # single chunk, but not the whole dimension.
     chunk_size = 5 * 3 - 1
     with set_chunk_size(chunk_size):
         slices = _all_slices(array)
     expected = [[0, 1, 2, 3],
                 [slice(0, 2, None), slice(2, 3, None)],
                 (slice(None, None, None),)]
     self.assertEqual(slices, expected)
Esempio n. 2
0
 def test_min(self):
     array = self._small_array()
     slices = _all_slices(array)
     expected = [[slice(0, 3, None), slice(3, 5, None)],
                 (slice(None, None, None), ), (slice(None, None, None), )]
     self.assertEqual(slices, expected)
Esempio n. 3
0
 def test_min(self):
     array = self._small_array()
     slices = _all_slices(array)
     expected = [[slice(0, 3, None), slice(3, 5, None)], (slice(None, None, None),), (slice(None, None, None),)]
     self.assertEqual(slices, expected)