neclib.core.inform.deprecation#

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 (Optional[Callable[[...], Any]]) – A callable object to be decorated.

  • version_since (Optional[str]) – The version since which the function is deprecated.

  • version_removed (Optional[str]) – The version in which the function will be removed.

  • reason (Optional[str]) – The reason for deprecation.

  • replacement (Optional[str]) – 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]#