Skip to content

expdocstring

expdocstring

Module for the experiment_docstring

Classes

Functions

experiment_docstring

experiment_docstring(cls)

extends the docstring of a experiment class with its attributes

Source code in niceml/experiments/schemas/expdocstring.py
def experiment_docstring(cls):
    """extends the docstring of a experiment class with its attributes"""
    cur_doc: str = cls.__doc__ or ""
    cur_doc = f"{cls.__name__}\n{'#'*len(cls.__name__)}\n\n" + cur_doc + "\n\n"
    exp_member_list: List[ExpMember] = get_expmembers_from_class(cls)
    for member in sorted(exp_member_list):
        cur_doc += f"{member.get_docstring()}\n\n"
    cls.__doc__ = cur_doc
    return cls