|
35 | 35 | extensions = [
|
36 | 36 | "sphinx.ext.autodoc",
|
37 | 37 | "sphinx.ext.viewcode",
|
38 |
| - "sphinx.ext.napoleon", |
| 38 | + "sphinx.ext.napoleon", # has to be loaded before sphinx_autodoc_typehints |
| 39 | + "sphinx_autodoc_typehints", |
39 | 40 | "sphinx.ext.intersphinx",
|
40 | 41 | "sphinx_qt_documentation",
|
41 | 42 | "sphinx_design",
|
42 | 43 | "sphinx_favicon",
|
43 | 44 | "sphinxext.rediraffe",
|
44 | 45 | "sphinxcontrib.images",
|
45 |
| - "sphinx_autodoc_typehints" |
46 | 46 | ]
|
47 | 47 |
|
48 | 48 | # Add any paths that contain templates here, relative to this directory.
|
|
67 | 67 | napoleon_use_admonition_for_notes = True
|
68 | 68 | napoleon_use_admonition_for_references = True
|
69 | 69 | napoleon_use_rtype = True
|
| 70 | +napoleon_use_param = False |
| 71 | +napoleon_use_keyword = False |
| 72 | +napoleon_attr_annotations = True |
| 73 | +napoleon_use_ivar = True |
70 | 74 | napoleon_custom_sections = [("Signals", "params_style")]
|
71 | 75 | napoleon_preprocess_types = True
|
72 | 76 | napoleon_type_aliases = {
|
|
77 | 81 | # 'ColorMapSpecifier': ':class:`str`, (:class:`str`, :class:`str`), or :class:`~pyqtgraph.ColorMap`',
|
78 | 82 | }
|
79 | 83 |
|
| 84 | + |
| 85 | +# makes things far more legible |
| 86 | +python_use_unqualified_type_names = True |
| 87 | +python_display_short_literal_types = True |
| 88 | + |
| 89 | + |
80 | 90 | # The encoding of source files.
|
81 | 91 | #source_encoding = 'utf-8-sig'
|
82 | 92 |
|
|
135 | 145 | # A list of ignored prefixes for module index sorting.
|
136 | 146 | #modindex_common_prefix = []
|
137 | 147 |
|
138 |
| -autodoc_inherit_docstrings = False |
| 148 | +# Automatically extract typehints when specified and place them in |
| 149 | +# descriptions of the relevant function/method. |
| 150 | +autodoc_typehints = "description" |
| 151 | +autodoc_typehints_format = 'short' |
| 152 | +autodoc_typehints_description_target = 'documented_params' |
| 153 | +autodoc_typehints_defaults = 'braces' |
| 154 | +autodoc_typehints_use_rtype = True |
| 155 | + |
| 156 | + |
139 | 157 | autodoc_mock_imports = [
|
140 | 158 | "scipy",
|
141 | 159 | "h5py",
|
142 | 160 | "matplotlib",
|
143 | 161 | ]
|
144 | 162 |
|
| 163 | +# autodoc_type_aliases = {} |
| 164 | + |
145 | 165 |
|
146 | 166 | # -- Options for HTML output ---------------------------------------------------
|
147 | 167 |
|
|
0 commit comments