def test_append_time_slice(self): self.write_slice('2019-01-01T14:30') append_time_slice(self.CUBE_PATH, self.make_slice('2019-01-02T01:14')) append_time_slice(self.CUBE_PATH, self.make_slice('2019-01-02T05:16')) append_time_slice(self.CUBE_PATH, self.make_slice('2019-01-03T03:50')) cube = xr.open_zarr(self.CUBE_PATH) expected = np.array([ '2019-01-02T02:30', '2019-01-02T13:14', '2019-01-02T17:16', '2019-01-03T15:50' ], dtype=cube.time.dtype) self.assertEqual(4, cube.time.size) self.assertEqual(None, cube.time.chunks) np.testing.assert_equal(cube.time.values, expected)
def append(self, dataset: xr.Dataset, output_path: str, **kwargs): append_time_slice(output_path, dataset)