def test_large(self): # Source data: 3 MB array = self._small_array() target = _WriteCounter(array.shape) with mock.patch('biggus._init.MAX_CHUNK_SIZE', 4096): biggus.save([array], [target]) self.assertTrue(target.all_written())
def test_large(self): # Source data: 15 GB small_array = self._small_array() array = biggus.ArrayStack([[small_array] * 1000] * 5) target = _WriteCounter(array.shape) biggus.save([array], [target]) self.assertTrue(target.all_written())
def test_mask(self): source = self._masked_array_with_mask() target = self._masked_array() biggus.save([source], [target], masked=True) self.assertTrue(target.mask[0, 7])
def test_small(self): # Source data: 3 MB array = self._small_array() target = _WriteCounter(array.shape) biggus.save([array], [target]) self.assertTrue(target.all_written())
def test_numbers(self): data = np.arange(12, dtype=np.float32).reshape(3, 4) + 10 array = biggus.NumpyArrayAdapter(data) target = np.zeros((3, 4)) biggus.save([array], [target]) np.testing.assert_array_equal(data, target)