syncopy.shared.kwarg_decorators._append_docstring#

syncopy.shared.kwarg_decorators._append_docstring(func, supplement, insert_in='Parameters', at_end=True)[source]#

Local helper to automate text insertions in docstrings

Parameters:
  • func (callable) – Typically a (wrapped) Syncopy metafunction such as freqanalysis()

  • supplement (str) – Text entry to be added to func’s docstring. Has to be already formatted correctly for its intended destination section, specifically respecting indentation and line-breaks (e.g., following double-indentation of variable descriptions in the “Parameters” section)

  • insert_in (str) – Name of section supplement should be inserted into. Available options are “Header” (part of the docstring before “Parameters”), “Parameters”, “Returns”, “Notes” and “See also”. Note that the section specified by insert_in has to already exist in func’s docstring, otherwise supplement is not inserted.

  • at_end (bool) – If True, supplement is appended at the end of the section specified by insert_in. If False, supplement is included at the beginning of the respective section.

Returns:

newDocString – A copy of func’s docstring with supplement inserted at the location specified by insert_in and at_end.

Return type:

str

Notes

This routine is a local auxiliary method that is purely intended for internal use. Thus, no error checking is performed.

See also

_append_signature

extend a function’s signature