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

Function inline_dask_repr

xarray/core/formatting.py:283–300  ·  view source on GitHub ↗

Similar to dask.array.DataArray.__repr__, but without redundant information that's already printed by the repr function of the xarray wrapper.

(array)

Source from the content-addressed store, hash-verified

281
282
283def inline_dask_repr(array):
284 """Similar to dask.array.DataArray.__repr__, but without
285 redundant information that's already printed by the repr
286 function of the xarray wrapper.
287 """
288 assert isinstance(array, array_type("dask")), array
289
290 chunksize = tuple(c[0] for c in array.chunks)
291
292 if hasattr(array, "_meta"):
293 meta = array._meta
294 identifier = (type(meta).__module__, type(meta).__name__)
295 meta_repr = _KNOWN_TYPE_REPRS.get(identifier, ".".join(identifier))
296 meta_string = f", meta={meta_repr}"
297 else:
298 meta_string = ""
299
300 return f"dask.array<chunksize={chunksize}{meta_string}>"
301
302
303def inline_sparse_repr(array):

Callers 1

Calls 4

array_typeFunction · 0.90
typeFunction · 0.85
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…