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

Function summarize_index

xarray/core/formatting_html.py:151–169  ·  view source on GitHub ↗
(coord_names, index)

Source from the content-addressed store, hash-verified

149
150
151def summarize_index(coord_names, index) -> str:
152 name = "<br>".join([escape(str(n)) for n in coord_names])
153
154 index_id = f"index-{uuid.uuid4()}"
155 preview = escape(inline_index_repr(index, max_width=70))
156 details = short_index_repr_html(index)
157
158 data_icon = _icon("icon-database")
159
160 return (
161 f"<div class='xr-index-name'><div>{name}</div></div>"
162 f"<div class='xr-index-preview'>{preview}</div>"
163 # need empty input + label here to conform to the fixed CSS grid layout
164 f"<input type='checkbox' disabled/>"
165 f"<label></label>"
166 f"<input id='{index_id}' class='xr-index-data-in' type='checkbox'/>"
167 f"<label for='{index_id}' title='Show/Hide index repr'>{data_icon}</label>"
168 f"<div class='xr-index-data'>{details}</div>"
169 )
170
171
172def summarize_indexes(indexes) -> str:

Callers 1

summarize_indexesFunction · 0.70

Calls 4

inline_index_reprFunction · 0.90
short_index_repr_htmlFunction · 0.85
_iconFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…