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
6
votes
1 answer

WARNING: toctree contains reference to nonexisting document error with Sphinx

I used the sphinx-quickstart to set everything up. I used doc/ for the documentation root location. The folder containing my package is setup as: myfolder/ doc/ mypackage/ __init__.py moprob.py ... After the quick…
magnoliafork
  • 95
  • 1
  • 7
6
votes
0 answers

Sphinx autosummary: create a summary of a module

I am having trouble getting sphinx to create a summary table for modules. I have added sphinx.ext.autosummary to my conf.py file and I am using numpydoc. Sphinx seems to create the summary table for attributes and methods on a class, but it does…
Stretch
  • 1,581
  • 3
  • 17
  • 31
5
votes
1 answer

Why do definitions have a space before the colon in NumPy docstring sections?

Numpy docstring guide says: The colon must be preceded by a space, or omitted if the type is absent. and gives an example: Parameters ---------- x : type Description of parameter `x`. y Description of parameter `y` (with type not…
hans
  • 1,043
  • 12
  • 33
5
votes
1 answer

How to document multiple return values in Numpydoc format?

I am trying to document a tuple return value using numpy docstring format, but can't make it work with pycharm type hinting. I have tried multiple ways, and even found one that was working for the type, but did not allow me to add a description for…
5
votes
1 answer

autosummary “toctree contains reference to nonexisting document” warnings

I am facing the same problem as in this thread. When I build my Sphinx documentation with make html then I get a lot of warnings like this None:None: WARNING: toctree contains reference to nonexisting document u'cars.Car.time_elapsed' I am using…
mr.bjerre
  • 2,384
  • 2
  • 24
  • 37
5
votes
1 answer

Sphinx Unexpected section title - numpydoc

I can not make Sphinx work correctly with numpy format. I am testing with this example, executing "make html", but I get several warnings to recognize Parameters, Notes, Returns, etc. For example: SEVERE: Unexpected section title. ERROR: Unexpected…
Romero Verde
  • 81
  • 1
  • 7
4
votes
0 answers

Sphinx and Read the Docs not using NumPy docs style

I documented some modules of a Python package I wrote using NumPy style, and I set up a readthedocs website to host the automatically generated documentation (with sphinx.ext.napoleon). Despite trying to follow the NumPy documentation style…
4
votes
2 answers

Sphinx documentation showing double-colon in fields

I am developing documentation for a package and when I build the sphinx docs I'm getting double colons for all of the fields for every function definition. I am using the numpydoc style for my docstrings and there are no colons in those docs to…
Nick Roach
  • 41
  • 3
4
votes
1 answer

How to type a list of int in numpydoc

What is the correct way to type a list of int in a numpydoc docstring. Is this syntax int[] for example valid ? def my_function(numbers): """ Parameters ---------- numbers : int[] List of numbers """ return…
johannchopin
  • 13,720
  • 10
  • 55
  • 101
4
votes
1 answer

How to properly document properties with NumpyDoc

I'm managing a package which uses the NumpyDoc style, and I'm trying to properly document the setters/getters of some properties. In particular, I'm having an issue with the fact that the documentation of the setter is ignored by python, and hence…
Jonas Adler
  • 10,365
  • 5
  • 46
  • 73
4
votes
1 answer

NumpyDoc Checking for conformity to the doc spec?

The Numpy project provides a specification for the the formatting of their documentation to support readability and automated extraction (link). They also provide Numpydoc, as an extension to Sphinx, to support extraction of some additional…
Jzl5325
  • 3,898
  • 8
  • 42
  • 62
4
votes
1 answer

Sphinx Extensions (numpydoc)

NOTE Added After: I finally got numpydoc working. It was also a python 2 problem. I ran 2to3 on it and now it seems to be working. OK, I've spent an entire day trying to get any Sphinx extension to work and am now hoping someone could point out…
ehudson
  • 205
  • 3
  • 6
3
votes
1 answer

Using array-like as a type in napoleon without warning

I have a project with some functions documented in the napoleon numpy style. In the spirit of numpyness, I have a bunch of function arguments that are of the class array-like. Here is an example: def foo(x, y): """ Foo the arguments together…
Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
3
votes
0 answers

Sphinx and Numpydoc throws parse error when inheriting from third party package

I'm trying to use Sphinx and numpydoc to document my code, yet very unsuccessfully so far. When I m trying to make html I get this very confusing error: Exception occurred: File…
Micromegas
  • 1,499
  • 2
  • 20
  • 49
3
votes
0 answers

Can py.test test docstring for the numpy style?

My pytest.ini currently looks like this: [pytest] addopts = --doctest-modules --cov=. --cov-report html --pep8 --flakes doctest_encoding = utf-8 So I already test for PEP8. But I would also like to test the docstrings for numpydoc format: Are all…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958