skcriteria.utils.deprecate module

Multiple decorator to use inside scikit-criteria.

exception skcriteria.utils.deprecate.SKCriteriaDeprecationWarning[source]

Bases: DeprecationWarning

Skcriteria deprecation warning.

exception skcriteria.utils.deprecate.SKCriteriaFutureWarning[source]

Bases: FutureWarning

Skcriteria future warning.

skcriteria.utils.deprecate.add_sphinx_deprecated_directive(doc, *, reason, version)[source]

Add the Sphinx deprecation directive to a given doc.

Parameters:
  • doc (str) – The original documentation.

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

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

skcriteria.utils.deprecate.warn(reason, version, *, category=<class 'skcriteria.utils.deprecate.SKCriteriaDeprecationWarning'>)[source]

Raises a deprecation warning.

It will result in a warning being emitted immediately

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

  • version (str) –

    Version of your project which marks as this feature. If you follow the Semantic Versioning, the version number has the format “MAJOR.MINOR.PATCH”.

  • category (default='SKCriteriaDeprecationWarning') – Class of the warning.

skcriteria.utils.deprecate.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.

Parameters:
  • 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”.

Notes

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

Check: <github https://pypi.org/project/Deprecated/>__

skcriteria.utils.deprecate.will_change(*, reason, version)[source]

Mark functions, classes and methods as “to be changed”.

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

Parameters:
  • reason (str) – Reason message which documents the “to be changed” in your library.

  • version (str) –

    Version of your project which marks as this feature. If you follow the Semantic Versioning, the version number has the format “MAJOR.MINOR.PATCH”.

Notes

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

Check: <github https://pypi.org/project/Deprecated/>__