pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.57k stars 1.07k forks source link

HTML repr for chunked variables with high dimensionality #8966

Open TomNicholas opened 5 months ago

TomNicholas commented 5 months ago

What is your issue?

The graphical representation of dask arrays with many dimensions can end up off the page in the HTML repr.

Screenshot 2024-04-23 at 6 00 04 PM

Ideally dask would worry about this for us, and we just use their _inline_repr, as mentioned here https://github.com/pydata/xarray/issues/4376#issuecomment-680296332

benbovy commented 5 months ago

Note that this is the full repr that is shown in the screenshot (not the inline repr).

One solution on the Xarray side could be to tweak the overflow-x CSS property of the (dask or other) array repr HTML container, e.g., likely change its value from "hidden" to "scroll". Although this will show a scrollbar in the case above so that may not look very nice either.

Or another solution on the Dask side is to update their full repr so that it is better displayed when wrapped in containers of smaller sizes.