scverse_misc.deprecated_arg#
- class scverse_misc.deprecated_arg(arg, msg, *, category=<class 'FutureWarning'>, stacklevel=1)#
Decorator to indicate that a function argument is deprecated.
Emits a warning when the decorated function is called with the deprecated argument. If the
scverse_miscSphinx extension is enabled, the documentation will be modified to include a deprecation notice.- Parameters:
arg (
LiteralString) – The deprecated argument.msg (
Deprecation) – The deprecation message.category (
type[Warning] (default:<class 'FutureWarning'>)) – The category of the warning that will be emitted at runtime.stacklevel (
int(default:1)) – The stack level of the warning.
Examples
>>> @deprecated_arg("bar", Deprecation("0.2", "The functionality has moved to the baz() function.")) ... def foo(baz, bar=1): ... pass
See also