neclib.core.inform.deprecation module#

Inform deprecation.

deprecated(__callable=None, *, version_since=None, version_removed=None, reason=None, replacement=None)[source]#

Decorator to mark a function as deprecated.

Parameters:
  • __callable (Callable[[...], Any] | None) – A callable object to be decorated.

  • version_since (str | None) – The version since which the function is deprecated.

  • version_removed (str | None) – The version in which the function will be removed.

  • reason (str | None) – The reason for deprecation.

  • replacement (str | None) – The replacement for the deprecated function.

Returns:

A callable object with deprecation warning.

Return type:

deprecated

Examples

>>> @deprecated
... def foo():
...     pass
>>> foo()
DeprecationWarning: The use of `foo` is deprecated. There is no replacement.
deprecated_namespace(*args, **kwargs)[source]#