Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: intersphinx fails to find the documentation for DTypeLike #23058

Closed
fjarri opened this issue Jan 21, 2023 · 1 comment
Closed

DOC: intersphinx fails to find the documentation for DTypeLike #23058

fjarri opened this issue Jan 21, 2023 · 1 comment

Comments

@fjarri
Copy link

fjarri commented Jan 21, 2023

Issue with current documentation:

In my library I am using numpy types and Sphinx 6.1.3 with intersphinx extension. The mapping is set to numpy 1.22 ("numpy": ("https://numpy.org/doc/1.22", None)), although I tried 1.24 as well.

When building the documentation, Sphinx correctly picks up typing annotations involving ndarray and dtype, and makes them hyperlinks to numpy docs. But it fails to do so for DTypeLike:

def myfunc(dtype: numpy.typing.DTypeLike) -> "numpy.dtype[Any]":
    ...
docstring of <...>:1: WARNING: py:class reference target not found: numpy.typing.DTypeLike

Idea or request for content:

I wonder if it could be the consequence of the docs for members of numpy.typing being generated in a roundabout fashion (in numpy.typing.__init__.py). Perhaps it is a Sphinx issue?

@fjarri
Copy link
Author

fjarri commented Jan 21, 2023

Actually, after rebuilding the docs from scratch, the error is different: multiple errors like

docstring of <...>:1: WARNING: py:class reference target not found: numpy._typing._dtype_like._DTypeDict

So it seems that Sphinx expands the union that is DTypeLike, but then can't find docs for some of the constituents. Seems to be a Sphinx problem, the workaround being autodoc_type_aliases setting in the config. Sorry for the issue, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant