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

Function diff_datatree_repr

xarray/core/formatting.py:1159–1178  ·  view source on GitHub ↗
(a: DataTree, b: DataTree, compat)

Source from the content-addressed store, hash-verified

1157
1158
1159def diff_datatree_repr(a: DataTree, b: DataTree, compat):
1160 summary = [
1161 f"Left and right {type(a).__name__} objects are not {_compat_to_str(compat)}"
1162 ]
1163
1164 if compat == "identical" and (diff_name := diff_name_summary(a, b)):
1165 summary.append(diff_name)
1166
1167 treestructure_diff = diff_treestructure(a, b)
1168
1169 # If the trees structures are different there is no point comparing each node,
1170 # and doing so would raise an error.
1171 # TODO we could show any differences in nodes up to the first place that structure differs?
1172 if treestructure_diff is not None:
1173 summary.append(treestructure_diff)
1174 elif compat != "isomorphic":
1175 nodewise_diff = diff_nodewise_summary(a, b, compat)
1176 summary.append(nodewise_diff)
1177
1178 return "\n\n".join(summary)
1179
1180
1181def inherited_vars(mapping: ChainMap) -> dict:

Callers 3

assert_isomorphicFunction · 0.90
assert_equalFunction · 0.90
assert_identicalFunction · 0.90

Calls 6

typeFunction · 0.85
_compat_to_strFunction · 0.85
diff_name_summaryFunction · 0.85
diff_treestructureFunction · 0.85
diff_nodewise_summaryFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…