From f55edb882c8ba810a776df20516941bcb487393e Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 9 Mar 2023 11:06:24 -0500 Subject: [PATCH] enable custom type aliases --- docs/sphinx/source/conf.py | 9 +++++++++ docs/sphinx/source/contributing.rst | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index cd2d6b379d..4640cf50b2 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -58,6 +58,15 @@ napoleon_use_rtype = False # group rtype on same line together with return +napoleon_type_aliases = { + # link to the sphinx targets & definitions in contributing.rst + 'dict-like': ':ref:`dict-like `', + 'numeric': ':ref:`numeric `', + 'array-like': ':ref:`array-like `', +} +napoleon_preprocess_types = True + + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/sphinx/source/contributing.rst b/docs/sphinx/source/contributing.rst index 3742d0af40..297cf5c2f9 100644 --- a/docs/sphinx/source/contributing.rst +++ b/docs/sphinx/source/contributing.rst @@ -238,9 +238,9 @@ allows for multiple input types to work for many parameters. pvlib uses the following generic descriptors as short-hand to indicate which specific types may be used: -* dict-like : dict, OrderedDict, pd.Series -* numeric : scalar, np.array, pd.Series. Typically int or float dtype. -* array-like : np.array, pd.Series. Typically int or float dtype. +* _`dict-like` : dict, OrderedDict, pd.Series +* _`numeric` : scalar, np.array, pd.Series. Typically int or float dtype. +* _`array-like` : np.array, pd.Series. Typically int or float dtype. Parameters that specify a specific type require that specific input type.