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

Function diff_nodewise_summary

xarray/core/formatting.py:1140–1156  ·  view source on GitHub ↗

Iterates over all corresponding nodes, recording differences between data at each location.

(a: DataTree, b: DataTree, compat)

Source from the content-addressed store, hash-verified

1138
1139
1140def diff_nodewise_summary(a: DataTree, b: DataTree, compat):
1141 """Iterates over all corresponding nodes, recording differences between data at each location."""
1142
1143 summary = []
1144 for path, (node_a, node_b) in group_subtrees(a, b):
1145 a_ds, b_ds = node_a.dataset, node_b.dataset
1146
1147 if not a_ds._all_compat(b_ds, compat):
1148 path_str = "root node" if path == "." else f"node {path!r}"
1149 dataset_diff = diff_dataset_repr(a_ds, b_ds, compat)
1150 data_diff = indent(
1151 "\n".join(dataset_diff.split("\n", 1)[1:]), prefix=" "
1152 )
1153 nodediff = f"Data at {path_str} does not match:\n{data_diff}"
1154 summary.append(nodediff)
1155
1156 return "\n\n".join(summary)
1157
1158
1159def diff_datatree_repr(a: DataTree, b: DataTree, compat):

Callers 1

diff_datatree_reprFunction · 0.85

Calls 5

group_subtreesFunction · 0.90
diff_dataset_reprFunction · 0.85
splitMethod · 0.80
_all_compatMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…