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

Function inline_variable_array_repr

xarray/core/formatting.py:310–325  ·  view source on GitHub ↗

Build a one-line summary of a variable's data.

(var, max_width)

Source from the content-addressed store, hash-verified

308
309
310def inline_variable_array_repr(var, max_width):
311 """Build a one-line summary of a variable's data."""
312 if hasattr(var._data, "_repr_inline_"):
313 return var._data._repr_inline_(max_width)
314 if getattr(var, "_in_memory", False):
315 return format_array_flat(var, max_width)
316 dask_array_type = array_type("dask")
317 if isinstance(var._data, dask_array_type):
318 return inline_dask_repr(var.data)
319 sparse_array_type = array_type("sparse")
320 if isinstance(var._data, sparse_array_type):
321 return inline_sparse_repr(var.data)
322 if hasattr(var._data, "__array_function__"):
323 return maybe_truncate(repr(var._data).replace("\n", " "), max_width)
324 # internal xarray array type
325 return "..."
326
327
328def summarize_variable(

Callers 4

summarize_variableFunction · 0.90
array_sectionFunction · 0.90
summarize_variableFunction · 0.85
array_reprFunction · 0.85

Calls 7

array_typeFunction · 0.90
format_array_flatFunction · 0.85
inline_dask_reprFunction · 0.85
inline_sparse_reprFunction · 0.85
maybe_truncateFunction · 0.85
replaceMethod · 0.80
_repr_inline_Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…