skcriteria.utils.decorators module

Multiple decorator to use inside scikit-criteria.

skcriteria.utils.decorators.doc_inherit(parent, warn_class=True)[source]

Inherit the ‘parent’ docstring.

Returns a function/method decorator that, given parent, updates the docstring of the decorated function/method based on the numpy style and the corresponding attribute of parent.

  • parent (Union[str, Any]) – The docstring, or object of which the docstring is utilized as the parent docstring during the docstring merge.

  • warn_class (bool) – If it is true, and the decorated is a class, it throws a warning since there are some issues with inheritance of documentation in classes.


This decorator is a thin layer over custom_inherit.doc_inherit decorator().

Check: <github>__

exception skcriteria.utils.decorators.SKCriteriaDeprecationWarning[source]

Bases: DeprecationWarning

Skcriteria deprecation warning.

skcriteria.utils.decorators.deprecated(*, reason, version)[source]

Mark functions, classes and methods as deprecated.

It will result in a warning being emitted when the object is called, and the “deprecated” directive was added to the docstring.

  • reason (str) – Reason message which documents the deprecation in your library.

  • version (str) – Version of your project which deprecates this feature. If you follow the Semantic Versioning, the version number has the format “MAJOR.MINOR.PATCH”.


This decorator is a thin layer over deprecated.deprecated().

Check: <github>__