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: TFunc) TFunc[source]

decorator that replaces text in the docstring of a function

get_text_block(identifier: str) str[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: TFunc, token: str, value: str, docstring: str = None) TFunc[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