bundles / scipy 1.17.1 / scipy / _lib / doccer / docformat
function
scipy._lib.doccer:docformat
source: /scipy/_lib/doccer.py :29
Signature
def docformat ( docstring : str , docdict : Mapping[str, str] | None = None ) → str Summary
Fill a function docstring from variables in dictionary.
Extended Summary
Adapt the indent of the inserted docs
Parameters
docstring: strA docstring from a function, possibly with dict formatting strings.
docdict: dict[str, str], optionalA dictionary with keys that match the dict formatting strings and values that are docstring fragments to be inserted. The indentation of the inserted docstrings is set to match the minimum indentation of the
docstringby adding this indentation to all lines of the inserted string, except the first.
Returns
docstring: strstring with requested
docdictstrings inserted.
Examples
docformat(' Test string with %(value)s', {'value':'inserted value'}) docstring = 'First line\n Second line\n %(value)s' inserted_string = "indented\nstring" docdict = {'value': inserted_string} docformat(docstring, docdict)✓
Aliases
-
scipy.signal._filter_design.doccer.docformat