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

Method test_auto_chunk

xarray/tests/test_backends.py:2766–2781  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2764
2765 @requires_dask
2766 def test_auto_chunk(self) -> None:
2767 original = create_test_data().chunk()
2768
2769 with self.roundtrip(original, open_kwargs={"chunks": None}) as actual:
2770 for k, v in actual.variables.items():
2771 # only index variables should be in memory
2772 assert v._in_memory == (k in actual.dims)
2773 # there should be no chunks
2774 assert v.chunks is None
2775
2776 with self.roundtrip(original, open_kwargs={"chunks": {}}) as actual:
2777 for k, v in actual.variables.items():
2778 # only index variables should be in memory
2779 assert v._in_memory == (k in actual.dims)
2780 # chunk size should be the same as original
2781 assert v.chunks == original[k].chunks
2782
2783 @requires_dask
2784 @pytest.mark.filterwarnings("ignore:The specified chunks separate:UserWarning")

Callers

nothing calls this directly

Calls 4

roundtripMethod · 0.95
create_test_dataFunction · 0.85
itemsMethod · 0.80
chunkMethod · 0.45

Tested by

no test coverage detected