Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/usage/extensions/napoleon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,20 @@ sure that "sphinx.ext.napoleon" is enabled in ``conf.py``:
:param arg2: Description of `arg2`
:type arg2: :term:`dict-like <mapping>`

Import aliases used in type definitions can be translated to names present
in intersphinx inventories. For example, to translate ``np.ndarray`` to
``numpy.ndarray``:

.. code-block:: python

napoleon_preprocess_types = True
napoleon_type_aliases = {
"np.ndarray": "numpy.ndarray",
}

Napoleon cannot infer module imports from type names written in docstrings,
so aliases must be configured explicitly.

.. versionadded:: 3.2

.. confval:: napoleon_attr_annotations
Expand Down
Loading