4.6.4 pde.tools.docstrings module

Methods for automatic transformation of docstrings.

get_text_block

Return a single text block.

replace_in_docstring

Replace a text in a docstring using the correct indentation.

fill_in_docstring

Decorator that replaces text in the docstring of a function.

fill_in_docstring(f)[source]

Decorator that replaces text in the docstring of a function.

Parameters:

f (TFunc)

Return type:

TFunc

get_text_block(identifier)[source]

Return a single text block.

Parameters:

identifier (str) – The name of the text block

Returns:

the text block as one long line.

Return type:

str

replace_in_docstring(f, token, value, docstring=None)[source]

Replace a text in a docstring using the correct indentation.

Parameters:
  • f (callable) – The function with the docstring to handle

  • token (str) – The token to search for

  • value (str) – The replacement string

  • docstring (str) – A docstring that should be used instead of f.__doc__

Returns:

The function with the modified docstring

Return type:

callable