Use autodoc_typehints = "description" in conf.py
See original GitHub issueš Documentation
EDITED HERE: As a help wanted issue, please, see below comment https://github.com/pytorch/ignite/issues/1665#issuecomment-783240506 on what remains to do here. Thanks
If there are many arguments in class/function/method, itās a little hard to read/scan all arguments (due to typehints).
Although there is a Parameters
section, there might be missing some arguments (rarely though).
And we are duplicating type hints work in both signatures and docstring. Writing once can make less work on authors and less type hints mismatch can occur.
If we can remove type hints, it can be a little easier to read, and showing type hints only in Parameters
section.
For example:
Before:
After:
Changing to this docs style needs a little work. It needs to
- add
autoclass_content = "both"
autodoc_typehints = "description" # new in sphinx 3.1
those lines in conf.py
- removing type hints in docstring
- leaving type hints only in signatures.
Let me know what you think. cc: @vfdev-5 @sdesrozis @trsvchn
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
OK, then I will start with
contrib.engines
module. On VSCode, you can use\(\w+.*(\s+\w+)*\):
regex for search and replace.Modules left to do:
Oh, I see, thanks for the clarification @ydcjeff ! I think we can proceed with that in parallel with other PRs and sync between them depending on which one is merged before.