make_help_function

utilipy.utils.make_help_function(name: str, module: Union[None, module, str] = None, look_for: Optional[str] = None, doctitle: Optional[str] = None) → Callable[source]

Set docstring from module Returns section.

Takes a helper function for a module and adds the content of the modules’ look_for section. Currently only works on numpy-style docstring.

Parameters
name: str

name of function. Add “_help”.

module:

Module

look_forstr, optional

The section to look for (default None) The section name “Routine Listings” is replaced by “Returns”

doctitlestr, optional
Returns
decoratorCallable

decorator function to change the wrapped function’s docstring.

Raises
TypeError

if look_for is not None or str

Notes

Todo

separate the imports help function from the general helps function. the general help function should be similar to the find_api_page in astropy and the help function in the utilipy init.