Adopt a documentation standard? #2
mwermelinger
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Should this project adopt the docstring style from Google or Numpy or is it overkill for these library functions?
For a quick overview of both styles, see the documentation of the sphinx napoleon extension.
The styles can be checked with a pylint extension. By default it doesn't check for the presence of the sections. I guess one can use
# pylint: disable=
to allow for optional sections in some docstrings.Pydocstyle can auto-detect the style of each docstring. It should be configurable in
pyproject.toml
withconvention = "numpy"
, for example.Google style
Args:
,Returns:
/Yields:
andRaises:
sections, but they are optional if the typing annotations and one-line summary are sufficient to understand the argument and return valuesAttributes:
section for public attributesNumpy style
Parameters
andReturns
/Yields
sectionsRaises
andSee also
sections (the latter refers to related functions/methods)Notes
section to provide more info, e.g. the algorithm used, or to cite papersExamples
section for doctests__init__
Attributes
Methods
section to list the most important methods, if the class has manyBeta Was this translation helpful? Give feedback.
All reactions