Skip to content

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

Closed

Description

@fjarri

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?

Activity

  1. fjarri commented on Jan 21, 2023

    @fjarri
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions