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

Function _obj_repr

xarray/core/formatting_html.py:307–325  ·  view source on GitHub ↗

Return HTML repr of an xarray object. If CSS is not injected (untrusted notebook), fallback to the plain text repr.

(obj, header_components, sections)

Source from the content-addressed store, hash-verified

305
306
307def _obj_repr(obj, header_components, sections):
308 """Return HTML repr of an xarray object.
309
310 If CSS is not injected (untrusted notebook), fallback to the plain text repr.
311
312 """
313 header = f"<div class='xr-header'>{''.join(h for h in header_components)}</div>"
314
315 icons_svg, css_style = _load_static_files()
316 return (
317 "<div>"
318 f"{icons_svg}<style>{css_style}</style>"
319 f"<pre class='xr-text-repr-fallback'>{escape(repr(obj))}</pre>"
320 "<div class='xr-wrap' style='display:none'>"
321 f"{header}"
322 f"{_sections_repr(sections)}"
323 "</div>"
324 "</div>"
325 )
326
327
328def array_repr(arr) -> str:

Callers 3

array_reprFunction · 0.85
dataset_reprFunction · 0.85
datatree_reprFunction · 0.85

Calls 3

_load_static_filesFunction · 0.85
_sections_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…