-
-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Labels
Description
In conf.py
I have set typehints_fully_qualified = False
.
However, while most type hints adhere to this, there are some cases where they appear fully qualified for no apparent reason.
For example
def mass_translator(
*,
mass_in: Union[str, MassDef],
mass_out: Union[str, MassDef],
concentration: Union[str, Concentration]
) -> Callable[[Cosmology, Union[Real, NDArray], Real],
Union[Real, NDArray]]:
while
def convert_concentration(
cosmo: Cosmology,
*,
c_old: Union[Real, NDArray[Real]],
Delta_old: Real,
Delta_new: Real
) -> Union[float, NDArray[float]]:
It also doesn't work well at all with numpy.typing.ArrayLike
, as it always fully qualifies it:
-> ArrayLike
This is the rest of the config for autodoc
and autodoc_typehints
:
# Additional `autodoc` options.
autodoc_default_options = {
"member-order": "bysource",
"show-inheritance": True,
"inherited-members": True,
"special-members": "__call__",
}
# Options for `sphnix_autodoc_typehints`.
typehints_fully_qualified = False
typehints_defaults = "braces"
typehints_document_rtype = False
typehints_use_signature_return = True
I use Sphinx 6.2.1 and Python 3.11 on Ubuntu 22.04 LTS.
sphinx_autodoc_typehints.__version__ = '1.21.8'
.