MCPcopy Create free account
hub / github.com/pydata/xarray / test_auto_chunk_da_cftime

Function test_auto_chunk_da_cftime

xarray/tests/test_dask.py:1173–1185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1171
1172
1173def test_auto_chunk_da_cftime():
1174 yrs = np.arange(2000, 2120)
1175 cftime_dates = xr.date_range(
1176 start=f"{yrs[0]}-01-01", end=f"{yrs[-1]}-12-31", freq="1YE", use_cftime=True
1177 )
1178 yr_array = np.tile(cftime_dates.values, (10, 1))
1179 da = xr.DataArray(
1180 yr_array, dims=["x", "t"], coords={"x": np.arange(10), "t": cftime_dates}
1181 ).chunk({"x": 4, "t": 5})
1182 actual = da.chunk("auto").data
1183 expected = da.data.rechunk({0: 10, 1: 120})
1184 np.testing.assert_array_equal(actual, expected)
1185 assert actual.chunks == expected.chunks
1186
1187
1188def test_map_blocks_error(map_da, map_ds):

Callers

nothing calls this directly

Calls 3

arangeMethod · 0.80
chunkMethod · 0.45
rechunkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…