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

Function diff_dataset_repr

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

Source from the content-addressed store, hash-verified

1112
1113
1114def diff_dataset_repr(a, b, compat):
1115 summary = [
1116 f"Left and right {type(a).__name__} objects are not {_compat_to_str(compat)}"
1117 ]
1118
1119 col_width = _calculate_col_width(set(list(a.variables) + list(b.variables)))
1120
1121 if dims_diff := diff_dim_summary(a, b):
1122 summary.append(dims_diff)
1123 if coords_diff := diff_coords_repr(a.coords, b.coords, compat, col_width=col_width):
1124 summary.append(coords_diff)
1125 if data_diff := diff_data_vars_repr(
1126 a.data_vars, b.data_vars, compat, col_width=col_width
1127 ):
1128 summary.append(data_diff)
1129
1130 if compat == "identical":
1131 if indexes_diff := diff_indexes_repr(a.xindexes, b.xindexes):
1132 summary.append(indexes_diff)
1133
1134 if attrs_diff := diff_attrs_repr(a.attrs, b.attrs, compat):
1135 summary.append(attrs_diff)
1136
1137 return "\n".join(summary)
1138
1139
1140def diff_nodewise_summary(a: DataTree, b: DataTree, compat):

Callers 1

diff_nodewise_summaryFunction · 0.85

Calls 7

typeFunction · 0.85
_compat_to_strFunction · 0.85
_calculate_col_widthFunction · 0.85
diff_dim_summaryFunction · 0.85
diff_coords_reprFunction · 0.85
diff_indexes_reprFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…