MCPcopy
hub / github.com/pydata/xarray / test_chunk_by_frequency_errors

Method test_chunk_by_frequency_errors

xarray/tests/test_dataset.py:1362–1371  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1360 assert rechunked.chunksizes["x"] == (2,) * 5
1361
1362 def test_chunk_by_frequency_errors(self):
1363 ds = Dataset({"foo": ("x", [1, 2, 3])})
1364 with pytest.raises(ValueError, match="virtual variable"):
1365 ds.chunk(x=TimeResampler("YE"))
1366 ds["x"] = ("x", [1, 2, 3])
1367 with pytest.raises(ValueError, match="datetime variables"):
1368 ds.chunk(x=TimeResampler("YE"))
1369 ds["x"] = ("x", xr.date_range("2001-01-01", periods=3, freq="D"))
1370 with pytest.raises(ValueError, match="Invalid frequency"):
1371 ds.chunk(x=TimeResampler("foo"))
1372
1373 @requires_dask
1374 def test_dask_is_lazy(self) -> None:

Callers

nothing calls this directly

Calls 3

chunkMethod · 0.95
DatasetClass · 0.90
TimeResamplerClass · 0.90

Tested by

no test coverage detected