AlbertUnruhUtils.utils.decorator module

AlbertUnruhUtils.utils.decorator.deprecated(since: Optional[Union[str, tuple[int]]] = None, *, instead: Optional[Union[str, Callable]] = None, update_docs: bool = True, doc_style: Literal['NumPy', 'numpy', 'NumPyDoc', 'numpydoc'] = 'NumPy') Callable[[_Function], _Function]

Marks a function/method as deprecated.

Parameters
  • since (_Version) – Since when the function/method is deprecated.

  • instead (str, Callable, optional) – What function/method should be used instead.

  • update_docs (bool) – Whether the docs should be updated or not.

  • doc_style (_Doc_Style) – The DocStyle to use to update the docs.

Return type

Callable[[_Function], _Function]

AlbertUnruhUtils.utils.decorator.copy_docs(docs: Union[str, object], *, append: bool = False, add_copy_note: bool = False, custom_origin: Optional[str] = None) Callable[[_Function], _Function]

Copies docs from an object or str to the decorated function/method/class.

Parameters
  • docs (str, object) – The docs to copy.

  • append (bool) – Whether the docs should be appended or be replaced.

  • add_copy_note (bool) – Whether the docs should have a note that it was copied or not.

  • custom_origin (str, optional) – The origin which should be displayed if add_copy_note is set to True.

Return type

Callable[[_Function], _Function]

AlbertUnruhUtils.utils.decorator.not_implemented(reason: Optional[str] = None, *, update_docs: bool = True, doc_style: Literal['NumPy', 'numpy', 'NumPyDoc', 'numpydoc'] = 'NumPy') Callable[[_Function], _Function]

Marks a function/method as not implemented, but as coming soon. (And they might open a PR to implement it for you :D)

Parameters
  • reason (str) – The reason why this function/method is not implemented yet.

  • update_docs (bool) – Whether the docs should be updated or not.

  • doc_style (_Doc_Style) – The DocStyle to use to update the docs.

Return type

Callable[[_Function], _Function]