Similar to dask.array.DataArray.__repr__, but without redundant information that's already printed by the repr function of the xarray wrapper.
(array)
| 281 | |
| 282 | |
| 283 | def 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 | |
| 303 | def inline_sparse_repr(array): |
no test coverage detected
searching dependent graphs…