Example_lib Testmodule

mylib docstring.

This module is only here to show how config options look inside the documention, when included from the doc-strings of actual python code.

class example_lib.BaseA(params)[source]

Example parent or base class.

config A_config
option default summary

fifth in BaseA.do_something

Multiple options documented at once. [...]

first

Describe the `first` parameter, context ``allowed``.

fourth in BaseA.do_something

Multiple options documented at once. [...]

second

Describe the `second` parameter. [...]

test

How does it handle adding references to other documents?

third in BaseA.do_something

Multiple options documented at once. [...]

option first: int

Describe the first parameter, context allowed.

option second: float

Describe the second parameter. You can reference other objects, e.g., OtherC.

Parameters

params (dict) – Parameters to be used as BaseA.params. See above A_config for details.

x

Usually equal 1+1.

Type

int

params

Parameters. See above

Type

dict

do_something()[source]

Some function using self.params.

option A_config.first: int

A different description of the first parameter.

option A_config.third: str
option A_config.fourth: str
option A_config.fifth: str

Multiple options documented at once. Works only if conf.py.cfg_options_parse_comma_sep_names is enabled.

class example_lib.ChildB(params)[source]

A subclass of BaseA.

config B_config
option default summary

fifth (from A_config) in BaseA.do_something

Multiple options documented at once. [...]

first (from A_config) in BaseA

Describe the `first` parameter, context ``allowed``.

fourth in ChildB.do_something_else

Yet another parameter that changes in `ChildB` compared to `BaseA`.

second (from A_config) in BaseA

Describe the `second` parameter. [...]

test (from A_config)

How does it handle adding references to other documents?

third

Another different description of of the `third` parameter, [...]

option third: str

Another different description of of the third parameter, see A_config.third for the one in the base class.

do_something()

Some function using self.params.

option A_config.first: int

A different description of the first parameter.

option A_config.third: str
option A_config.fourth: str
option A_config.fifth: str

Multiple options documented at once. Works only if conf.py.cfg_options_parse_comma_sep_names is enabled.

do_something_else()[source]

Another method using self.params.

option B_config.fourth: str

Yet another parameter that changes in ChildB compared to BaseA.

class example_lib.OtherC[source]

Another class.

run()[source]

do nothing.

example_lib.complicated_function(a, b, c, params)[source]

A complicated function.

config complicated_function
option default summary

Na

Number of repetitions for `a`.

option Na: int

Number of repetitions for a.

Parameters
  • a (int) – Parameter a description.

  • b (mylib.B) – Parameter b description.

  • complicated_params (dict) – Parameters.

Returns

x – The sum of a and b

Return type

int