pydata / pydata/xarray

Updated `See also` section in the docstrings broke numpydoc

Open
#8,596 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-documentation
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What happened?

Hi, I would like to report that https://github.com/pydata/xarray/pull/8311 broke the documentation build of Datashader. Datashader's documentation uses Sphinx and numpydoc to process its docstrings. It turns out (I had no idea) that numpydoc processes more doctrings than I'd have expected, including xarray's ones. The changes in the PR made numpydoc unhappy. To reproduce run:

python3 -m venv .venv                                                                                         
source .venv/bin/activate
pip install numpydoc
python -m numpydoc.hooks.validate_docstrings xarray/core/dataarray.py

You'll get this error:

ValueError: Error parsing See Also entry ':doc:`xarray-tutorial:intermediate/indexing/indexing`'

I'm pretty sure this is not an xarray issue but felt that opening an issue here might be useful for others encountering this issue. Really, feel free to close it.

What did you expect to happen?

No response

Minimal Complete Verifiable Example

No response

MVCE confirmation
  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of xarray and its dependencies.
Relevant log output

No response

Anything else we need to know?

No response

Environment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running python -m numpydoc.hooks.validate_docstrings xarray/core/dataarray.py in the reported virtual environment and inspect the See Also changes from pull request 8311. Determine whether the xarray docstrings should be adjusted to avoid the numpydoc parsing error; done means validation no longer reports the cited error or the issue is shown to belong to numpydoc instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.