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

Function diff_chunks

xarray/tests/test_backends_datatree.py:53–67  ·  view source on GitHub ↗
(
    comparison: dict[tuple[str, Hashable], bool], tree1: DataTree, tree2: DataTree
)

Source from the content-addressed store, hash-verified

51
52
53def diff_chunks(
54 comparison: dict[tuple[str, Hashable], bool], tree1: DataTree, tree2: DataTree
55) -> str:
56 mismatching_variables = [loc for loc, equals in comparison.items() if not equals]
57
58 variable_messages = [
59 "\n".join(
60 [
61 f"L {path}:{name}: {tree1[path].variables[name].chunksizes}",
62 f"R {path}:{name}: {tree2[path].variables[name].chunksizes}",
63 ]
64 )
65 for path, name in mismatching_variables
66 ]
67 return "\n".join(["Differing chunk sizes:"] + variable_messages)
68
69
70def assert_chunks_equal(

Callers 1

assert_chunks_equalFunction · 0.85

Calls 2

itemsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…