nvflare.fuel.utils.deprecated module

deprecated(reason)[source]

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

warn_deprecated(message: str, stacklevel: int = 2)[source]

Issue a DeprecationWarning once per process for each unique message.

stacklevel follows the same convention as warnings.warn(): 2 (the default) points at the direct caller of warn_deprecated. Pass 3 when calling from inside an __init__ so the warning location is the code that instantiates the class rather than the __init__ body.