MCPcopy Index your code
hub / github.com/pydata/xarray / test_chunk_encoding

Method test_chunk_encoding

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

Source from the content-addressed store, hash-verified

2887 assert v.chunks == actual[k].chunks
2888
2889 def test_chunk_encoding(self) -> None:
2890 # These datasets have no dask chunks. All chunking specified in
2891 # encoding
2892 data = create_test_data()
2893 chunks = (5, 5)
2894 data["var2"].encoding.update({"chunks": chunks})
2895
2896 with self.roundtrip(data) as actual:
2897 assert chunks == actual["var2"].encoding["chunks"]
2898
2899 # expect an error with non-integer chunks
2900 data["var2"].encoding.update({"chunks": (5, 4.5)})
2901 with pytest.raises(TypeError):
2902 with self.roundtrip(data) as actual:
2903 pass
2904
2905 def test_shard_encoding(self) -> None:
2906 # These datasets have no dask chunks. All chunking/sharding specified in

Callers

nothing calls this directly

Calls 3

roundtripMethod · 0.95
create_test_dataFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected