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
1
vote
1 answer

Sphinx not removing doctest flags in html output

I cannot eliminate the doctest flags (ie. , # doctest: +ELLIPSIS) for the html output. I am able to generate the documentation as I would like, so no errors there but it includes theses flags which I would like removed. Sphinx…
dshanahan
  • 676
  • 5
  • 12
1
vote
1 answer

Python auto docstring with sphinx new line

I am wondering how can I have a new line when generating auto documentation using Sphinx. I am not using the default Sphinx docstring format reStructuredText, but I am using the Numpydoc format. I tried using '\n' yet it makes a line break, and I…
Kernel
  • 591
  • 12
  • 23
1
vote
1 answer

label in python docstring

I'm using sphinx autodoc to translate my docstring to a nice documentation page. In the docstring I'm following numpy's docstring guideline by using the sphinx napoleon extension. I'm wondering about the following: If I have an equation…
math
  • 1,868
  • 4
  • 26
  • 60
1
vote
1 answer

numpydoc conventions: method modifies class but returns nothing

Question about numpydoc docstring conventions: I have a class that contains a number of methods that return nothing, but add an attribute to the class. For example: class MyClass(object): def __init__(self, a, b): self.a = a …
oscarbranson
  • 3,877
  • 1
  • 13
  • 15
1
vote
2 answers

disable automatic autosummary created by numpydoc

Is it possible do disable the complete autosummary when using autodoc? I've got a class derived from a Python standard library class, which has many public methods. My custom class should work as a wrapper, directly providing methods to communicate…
Finwood
  • 3,829
  • 1
  • 19
  • 36
1
vote
1 answer

NumpyDoc: How are tabs parsed?

I'm using the Spyder IDE (v.2.1.11 on Mac OS) and writing some code, and in writing a DocString (NumpyDoc format) for a function, can't figure out why the Spyder Object Inspector formats an indented line in this strange way. For a Docstring like the…
Demis
  • 5,278
  • 4
  • 23
  • 34
0
votes
0 answers

Sphinx autosummary of class attributes not included in the proper toctree with numpydoc?

My class.rst: {% extends "!autosummary/class.rst" %} {% block methods %} {% if methods %} .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. .. autosummary:: …
Astral Cai
  • 63
  • 7
0
votes
0 answers

Can I prevent sphinx numpydoc to split the Returns into two sections

When using sphinx numpydoc I document the Returns section. Returns ------- out: float A sentence about the return type However, rendered this is split into two sections. Returns: out - A sentence about the return type Return type: …
Hielke Walinga
  • 2,677
  • 1
  • 17
  • 30
0
votes
1 answer

Dynamically substitute any Sphinx references

Summary of the Issue I am using a fork of a popular package, scikit-learn, (yes I need a fork for specific technical reasons) that has a documentation hosted with Sphinx. I want to simultaneously use the fork I have and scikit-learn itself, so I…
ajl123
  • 1,172
  • 5
  • 17
  • 40
0
votes
0 answers

Sphinx parent class in another package: how to disable single backtick reference warnings

I am working on implementing a Python package that inherits from networkx. Networkx seems to use numpydoc, but also wraps certain parts of their docstrings in single backtick characters: `. This normally in rst files denotes italics, but in numpydoc…
ajl123
  • 1,172
  • 5
  • 17
  • 40
0
votes
0 answers

Display directly first element of Sphinx index.rst's toctree instead of a blank page

I have a Python package (https://github.com/frannerin/AlloViz)'s documentation (https://alloviz.readthedocs.io/) with the following structure: AlloViz/docs/source │ conf.py │ index.rst │ README.rst │ └───API │ index.rst │ …
0
votes
0 answers

sphinx (numpydoc) syntax warnings showing up in wrong file using vscode

In my docs/source/conf.py file, I have the numpydoc extension enabled, and it's generally working, except I'm getting docstring errors from different python files showing up as being caused in line 1, column 1 of the conf.py file instead of the…
DilithiumMatrix
  • 17,795
  • 22
  • 77
  • 119
0
votes
0 answers

docstring codeblock not showing properly in spyder 5.2.21

I'm trying to comment my python function that I have written, according to sphinx and numpy docstring. Spyder uses sphinx to render the docstring in the help window. When I see my docstring in window I Don't see title and other thing .... …
Ptiji
  • 1
0
votes
0 answers

Sphinx Module Docstring Command Line Parameters/Argparse

What is the standard sphinx docstring format for module command line parameters? For example: if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-f', '--file', default=f'{PATH}/data/', help='excel…
Hersh Joshi
  • 419
  • 3
  • 13
0
votes
0 answers

Get autosummary to produce a flat representation

If I have a file foo.baz.py: from foo.bar.baz import Quux, Quuux __all__ = ['Quux', 'Quuux'] I'd like to document the api as follows: Baz === .. currentmodule:: foo.baz .. autosummary:: :toctree: generated/ :nosignatures: Quux …
oulenz
  • 1,199
  • 1
  • 15
  • 24