Readthedocs
sphinxcontrib-napoleon.readthedocs.io › en › latest › example_numpy.html
Example NumPy Style Python Docstrings — napoleon 0.7 documentation
Attributes ---------- module_level_variable1 : int Module level variables may be documented in either the ``Attributes`` section of the module docstring, or in an inline docstring immediately following the variable. Either form is acceptable, but the two should not be mixed. Choose one convention to document module level variables and be consistent with it. .. _NumPy Documentation HOWTO: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt """ module_level_variable1 = 12345 module_level_variable2 = 98765 """int: Module level variable documented inline.
Readthedocs
numpydoc.readthedocs.io › en › latest › format.html
Style guide — numpydoc v1.11.1.dev1+gca74aae44 Manual
Support for the Yields section was added in numpydoc version 0.6. Explanation of parameters passed to a generator’s .send() method, formatted as for Parameters, above. Since, like for Yields and Returns, a single object is always passed to the method, this may describe either the single parameter, or positional arguments passed as a tuple. If a docstring includes Receives it must also include Yields.
Lsst
developer.lsst.io › python › numpydoc.html
Documenting Python APIs with docstrings — LSST DM Developer Guide main documentation
""" msg = None """Human readable string describing the exception (`str`). """ code = None """Numeric error code (`int`). """ def __init__(self, msg, code=None): self.msg = msg self.code = code · These docstring guidelines are derived/adapted from the Numpydoc and Astropy documentation.
Sphinx
sphinx-doc.org › en › master › usage › extensions › example_numpy.html
Example NumPy Style Python Docstrings — Sphinx documentation
Attributes ---------- module_level_variable1 : int Module level variables may be documented in either the ``Attributes`` section of the module docstring, or in an inline docstring immediately following the variable. Either form is acceptable, but the two should not be mixed. Choose one convention to document module level variables and be consistent with it. .. _NumPy docstring standard: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard """ module_level_variable1 = 12345 module_level_variable2 = 98765 """int: Module level variable documented inline.
NumPy
numpy.org › devdocs › dev › howto-docs.html
How to contribute to the NumPy documentation — NumPy v2.5.dev0 Manual
Using numpydoc will also avoid the reStructuredText errors produced by plain Sphinx when it encounters NumPy docstring conventions like section headers (e.g. -------------) that sphinx does not expect to find in docstrings. ... Note that for documentation within NumPy, it is not necessary to do import numpy as np at the beginning of an example. Please use the numpydoc formatting standard as shown in their example. NumPy uses Doxygen to parse specially-formatted C/C++ comment blocks.
NumPy
numpy.org › doc › stable › dev › howto-docs.html
How to contribute to the NumPy documentation — NumPy v2.5 Manual
Using numpydoc will also avoid ... find in docstrings. ... Note that for documentation within NumPy, it is not necessary to do import numpy as np at the beginning of an example. Please use the numpydoc formatting standard as shown in their example. NumPy uses Doxygen to parse specially-formatted C/C++ comment blocks...
Starred by 51 users
Forked by 8 users
Languages: Emacs Lisp
GitHub
github.com › emacsmirror › numpydoc
GitHub - emacsmirror/numpydoc: NumPy style docstring insertion · GitHub
Calling numpydoc-generate parses a function signature and body (corresponding to the current cursor location; just have the cursor somewhere in the function you want to document) detecting argument names, type hints, exceptions, and the return type hint. This information is used to generate a docstring.
Author: emacsmirror
Sphinx-gallery
sphinx-gallery.github.io › dev › tutorials › plot_parse.html
Alternating text and code — Sphinx-Gallery 0.20.dev0-git documentation
It was designed to be compared ... header docstring above. import numpy as np # noqa: F401 # %% # You can separate code blocks using either a single line of ``#``'s # (>=20 columns), ``#%%``, or ``# %%``. For consistency, it is recommend that # you use only one of the above ...
NumPy
numpy.org › doc › 1.20 › docs › howto_document.html
A Guide to NumPy Documentation — NumPy v1.20 Manual
January 31, 2021 - When using Sphinx in combination with the numpy conventions, you should use the numpydoc extension so that your docstrings will be handled correctly. For example, Sphinx will extract the Parameters section from your docstring and convert it into a field list.
DataCamp
datacamp.com › tutorial › docstrings-python
Python Docstrings Tutorial : Examples & Format for Pydoc, Numpy, Sphinx Doc Strings | DataCamp
February 14, 2025 - Learn about Python Docstrings. Find different examples & format types of docstrings for Sphinx, Numpy and Pydoc.
NumPy
numpy.org › doc › 1.19 › docs › howto_document.html
A Guide to NumPy/SciPy Documentation — NumPy v1.19 Manual
Use *italics*, **bold** and ``monospace`` if needed in any explanations (but not for variable names and doctest code or multi-line code). Variable, module, function, and class names should be written between single back-ticks (`numpy`). A more extensive example of reST markup can be found in this example document; the quick reference is useful while editing. Line spacing and indentation are significant and should be carefully followed. This document itself was written in ReStructuredText. An example of the format shown here is available. """This is the docstring for the example.py module.
Readthedocs
numpydoc.readthedocs.io › en › v1.0.0 › format.html
numpydoc docstring guide — numpydoc v1.0 Manual
Support for the Yields section was added in numpydoc version 0.6. ... Explanation of parameters passed to a generator’s .send() method, formatted as for Parameters, above. Since, like for Yields and Returns, a single object is always passed to the method, this may describe either the single parameter, or positional arguments passed as a tuple. If a docstring includes Receives it must also include Yields.
Python-sprints
python-sprints.github.io › pandas › guide › pandas_docstring.html
pandas docstring guide — Python documentation
In rare occasions reST styles like bold text or itallics will be used in docstrings, but is it common to have inline code, which is presented between backticks. It is considered inline code: ... Python code, a module, function, built-in, type, literal… (e.g. os, list, numpy.abs, datetime.date, True)
Pyansys
dev.docs.pyansys.com › doc-style › docstrings.html
Numpydoc docstrings — PyAnsys developer's guide
Surrounding text in a single backtick in a PyAnsys library formats it in italic type rather than as a code entity. PyAnsys library docstrings contain these numpydoc sections as a minimum:
Mkdocstrings
mkdocstrings.github.io › pytkdocs › reference › pytkdocs › parsers › docstrings › numpy
pytkdocs.parsers.docstrings.numpy - mkdocstrings
A Numpy-style docstrings parser. Source code in src/pytkdocs/parsers/docstrings/numpy.py
Noirlab
datalab.noirlab.edu › docs › manual › DevGuide › styleguide › numpydoc.html
3.3. Documenting Python APIs with Docstrings — Data Lab 1.1.1 documentation
October 11, 2020 - """ msg = None """Human readable string describing the exception (`str`). """ code = None """Numeric error code (`int`). """ def __init__(self, msg, code=None): self.msg = msg self.code = code · These docstring guidelines are derived/adapted from the NumPy and Astropy documentation.