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

Method test_split_chunks

xarray/tests/test_backends_api.py:248–257  ·  view source on GitHub ↗

Warn when the requested chunks separate the backend's preferred chunks.

(self, shape, pref_chunks, req_chunks)

Source from the content-addressed store, hash-verified

246 ],
247 )
248 def test_split_chunks(self, shape, pref_chunks, req_chunks):
249 """Warn when the requested chunks separate the backend's preferred chunks."""
250 initial = self.create_dataset(shape, pref_chunks)
251 with pytest.warns(UserWarning):
252 final = xr.open_dataset(
253 initial,
254 engine=PassThroughBackendEntrypoint,
255 chunks=dict(zip(initial[self.var_name].dims, req_chunks, strict=True)),
256 )
257 self.check_dataset(initial, final, explicit_chunks(req_chunks, shape))
258
259 @pytest.mark.parametrize(
260 "shape,pref_chunks,req_chunks",

Callers

nothing calls this directly

Calls 4

create_datasetMethod · 0.95
check_datasetMethod · 0.95
explicit_chunksFunction · 0.85
open_datasetMethod · 0.45

Tested by

no test coverage detected