Questions tagged [numpydoc]

Numpydoc is a set of extensions for the Sphinx documentation generator, it adds support for docstrings formatted according to the NumPy documentation format.

Numpydoc is a set of extensions for the Sphinx documentation generator, it adds support for docstrings formatted according to the NumPy documentation format. It is licensed under the BSD license.

The parsing of NumPy style docstrings can be made by the Napoleon extension of Sphinx. NumPy style docstrings are converted to ReStructuredText before they are processed by Sphinx into documentation. This allows use of both reStructuredText in docstrings together with the addition of NumPy style docstrings.

Official Numpydoc site.

Sphinx support for NumPy and Google docstrings.

65 questions
23
votes
1 answer

Sphinx Autodoc and NumpyDoc

despite reading this tutorial, this question and the numpy docstring standard, I'm unable to get sphinx autodoc to play nicely with numpy docstrings. In my conf.py I have: extensions = ['sphinx.ext.autodoc', 'numpydoc'] and in my doc file I have: …
LondonRob
  • 73,083
  • 37
  • 144
  • 201
18
votes
3 answers

Is it possible to hide Python function arguments in Sphinx?

Suppose I have the following function that is documented in the Numpydoc style, and the documentation is auto-generated with the Sphinx autofunction directive: def foo(x, y, _hidden_argument=None): """ Foo a bar. Parameters …
SethMMorton
  • 45,752
  • 12
  • 65
  • 86
15
votes
1 answer

Is there any way to lint a Python file to check for Numpy documentation style adherence?

I'm working on a project that requires Numpy documentation. In my Java days, I remember having linters that checked for Javadoc adherence in Eclipse/IDEA; is there an equivalent that checks for Numpy documentation style adherence? I know about…
Mark Bao
  • 896
  • 1
  • 10
  • 19
14
votes
1 answer

Difference between sphinxcontrib.napoleon and numpy.numpydoc

I am writing documentation for a Python project using Numpy-style docstrings. numpydoc and napoleon are two Sphinx extensions that parse Numpy-style docstrings to generate documentation. The first one is used for the Numpy project itself, the second…
ndou
  • 1,048
  • 10
  • 15
11
votes
2 answers

List of class methods with Napoleon Sphinx extension using NumPyDoc style

I am using NumPyDoc-style docstrings to document a Python package. I would like to switch from the 'numpydoc' Sphinx extension to Napoleon, because I find that it formats the docstring in a more compact and readable way. However, it does not list…
Pietro Marchesi
  • 852
  • 2
  • 8
  • 18
11
votes
4 answers

Should you always document functions, even if redundant (specifically python)?

I try to use function names that are active and descriptive, which I then document with active and descriptive text (!). This generates redundant-looking code. Simplified (but not so unrealistic) example in python, following numpy docstring…
barford
  • 119
  • 1
  • 4
10
votes
3 answers

sphinx warning: autosummary: stub file not found for the methods of the class. check your autosummary_generate settings

I have an open source package with lots of classes over different submodules. All classes have methods fit and transform, and inherit fit_transform from sklearn. All classes have docstrings that follow numpydoc with subheadings Parameters,…
Sole Galli
  • 827
  • 6
  • 21
9
votes
1 answer

How can I parse a numpydoc docstring and access components?

I'd like to parse a numpydoc docstring and access each component programatically. For example: def foobar(a, b): '''Something something Parameters ---------- a : int, default: 5 Does something cool b : str …
trianta2
  • 3,952
  • 5
  • 36
  • 52
8
votes
1 answer

Is it possible to have a list for a parameter in sphinx.ext.napoleon?

I'm using sphinx autodoc extension together with sphinx.ext.napoleon. I'm following numpydoc style guide since I think it is more readable than google's one. However, I've noticed the following issue which I wasn't able to fix. I have the following…
math
  • 1,868
  • 4
  • 26
  • 60
8
votes
1 answer

How does 'autodoc_default_flags' work in python Sphinx configuration?

I am trying to generate documentation for my python classes using Sphinx 1.4 and sphinx-apidoc and the sphinx.ext.autodoc extension. I have a lot of modules and I want each to only show class names, but not the full list of methods in the class…
sgt_pats
  • 161
  • 3
  • 8
7
votes
1 answer

Can mypy check docstrings?

I have numpydoc-style docstrings: def foobar(filename, copy, dtype, iterable, shape, files): """ foobar is 42. Parameters ---------- filename : str copy : bool dtype : data-type iterable : iterable object shape :…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
7
votes
0 answers

Bullet Lists after Paragraph in Python Docstring sometimes don't work with sphinx and numpydoc

Documenting a Python module using the numpy style and generating html documentation using sphinx and the numpydoc extension, I stumbled upon a bug (or feature?) regarding bulleted lists. In reStructuredText (and sphinx/numpydoc), a single-lined…
Finwood
  • 3,829
  • 1
  • 19
  • 36
7
votes
2 answers

Autosummary with toctree not creating documentation for methods

I'm using sphinx with the numpydoc extension and autosummary. After some experimentation, I added the following options to my conf.py file. autosummary_generate = True numpydoc_show_class_members = False This is giving me a new file for each class…
kesmit
  • 121
  • 1
  • 4
7
votes
1 answer

How can I use intersphinx with Tensorflow and numpydoc?

The main question here is where (if) there is an objects.inv for TensorFlow, but an example how to actually use it would be nice. For example, I currently have the following docstring: """ Load the weights of a model stored in…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
7
votes
2 answers

Sphinx autodoc not importing anything?

I'm trying to use sphinx (in conjunction with autodoc and numpydoc) to document my module, but after the basic setup, running make html produces just the basic html with nothing from the docstrings included. I'm running Python 3.3, the outline of…
George Oblapenko
  • 878
  • 1
  • 10
  • 23
1
2 3 4 5