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

Function dims_and_coords_repr

xarray/core/formatting.py:814–834  ·  view source on GitHub ↗

Partial Dataset repr for use inside DataTree inheritance errors.

(ds)

Source from the content-addressed store, hash-verified

812
813
814def dims_and_coords_repr(ds) -> str:
815 """Partial Dataset repr for use inside DataTree inheritance errors."""
816 summary = []
817
818 col_width = _calculate_col_width(ds.coords)
819 max_rows = OPTIONS["display_max_rows"]
820
821 dims_start = pretty_print("Dimensions:", col_width)
822 dims_values = dim_summary_limited(
823 ds.sizes, col_width=col_width + 1, max_rows=max_rows
824 )
825 summary.append(f"{dims_start}({dims_values})")
826
827 if ds.coords:
828 summary.append(coords_repr(ds.coords, col_width=col_width, max_rows=max_rows))
829
830 unindexed_dims_str = unindexed_dims_repr(ds.dims, ds.coords, max_rows=max_rows)
831 if unindexed_dims_str:
832 summary.append(unindexed_dims_str)
833
834 return "\n".join(summary)
835
836
837def diff_name_summary(a, b) -> str:

Callers 1

check_alignmentFunction · 0.90

Calls 6

_calculate_col_widthFunction · 0.85
pretty_printFunction · 0.85
dim_summary_limitedFunction · 0.85
coords_reprFunction · 0.85
unindexed_dims_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…