xarray icon indicating copy to clipboard operation
xarray copied to clipboard

Documentation rendering bug - `set_options`

Open ianhi opened this issue 3 months ago • 2 comments

What is your issue?

The default value for netcdf_order in set options is not being properly rendered by sphinx:

https://docs.xarray.dev/en/stable/generated/xarray.set_options.html Image

I tried to get this to work by adding a colon and switch to a tuple. but neither, nor their combination fixed this.

Code defined here: https://github.com/pydata/xarray/blob/20d377347154412aed41697da23274ca48c0fd54/xarray/core/options.py#L263-L267

ianhi avatar Oct 08 '25 19:10 ianhi

Did you try to use double quotes? There are double quotes used in other parts of that docstring.

kmuehlbauer avatar Oct 17 '25 08:10 kmuehlbauer

for this to work we would need sphinx.ext.napoleon to support tuples, which even after changing in sphinx will take a while to get (some of our docs dependencies have upper bounds on the sphinx version). For now, I think we can work around this by replacing the default with optional and mentioning the defaults in the text.

keewis avatar Oct 21 '25 21:10 keewis