Skip to content

Xarray dataset html repr is not correctly formatted #815

@sandorkertesz

Description

@sandorkertesz

If I have a notebook with an Xarray html repr the generated Sphinx html documentation using NBSphinx looks rather different containing a lot of empty space. This is a concrete example:

import xarray as xr
url="https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.oisst.v2/sst.mnmean.nc"
ds = xr.open_dataset(url)
ds

Notebook:
image

Generated Sphinx html documentation:
image

This happened to all the Xarray datasets I tried in my various projects.

My Sphinx configuration can be found here:
https://github.com/ecmwf/earthkit-data/blob/develop/docs/conf.py
It is using this CSS file: https://github.com/ecmwf/earthkit-data/blob/develop/docs/_static/style.css
However, even when not using this CSS file the problem still occurs.

In my latest tests I used this environment (Python 3.10.13):
docutils 0.20.1
nbclient 0.8.0
nbconvert 7.16.4
nbformat 5.9.2
nbsphinx 0.9.3
Pygments 2.17.2
Sphinx 7.3.7
sphinx-autoapi 3.0.0
sphinx-issues 4.1.0
sphinx-rtd-theme 2.0.0
sphinxcontrib-apidoc 0.3.0
sphinxcontrib-applehelp 1.0.7
sphinxcontrib-devhelp 1.0.5
sphinxcontrib-htmlhelp 2.0.4
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.6
sphinxcontrib-serializinghtml 1.1.9
xarray-2024.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions