aztk/utils/deprecation.py
def deprecated(version: str, advice: str = None):
    """
    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.

    Args:
        version (str): The version in which the deprecated functionality will be removed
        advice (str): Sentence explaining alternatives to the deprecated functionality.
    """

    def decorator(func):
        if inspect.isclass(func):
            msg = "Call to deprecated class {name}."
        else:
            msg = "Call to deprecated function {name}."

        @functools.wraps(func)
        def new_func(*args, **kwargs):
            deprecate(version=version, message=msg.format(name=func.__name__, advice=advice), advice=advice)
            return func(*args, **kwargs)

        return new_func

    return decorator

    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.

    Args:
        version (str): The version in which the deprecated functionality will be removed
        advice (str): Sentence explaining alternatives to the deprecated functionality.
    
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.
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 .
def deprecated(version: str, advice: str = None):
    def decorator(func):
        if inspect.isclass(func):
            msg = "Call to deprecated class {name}."
        else:
            msg = "Call to deprecated function {name}."
        @functools.wraps(func)
        def new_func(*args, **kwargs):
            deprecate(version=version, message=msg.format(name=func.__name__, advice=advice), advice=advice)
            return func(*args, **kwargs)
        return new_func
    return decorator
def deprecated ( version : str , advice : str = None ) : def decorator ( func ) : if inspect . isclass ( func ) : msg = "Call to deprecated class {name}." else : msg = "Call to deprecated function {name}." @ functools . wraps ( func ) def new_func ( * args , ** kwargs ) : deprecate ( version = version , message = msg . format ( name = func . __name__ , advice = advice ) , advice = advice ) return func ( * args , ** kwargs ) return new_func return decorator
This is a decorator which can be used to mark functions
as deprecated.
This is a decorator which can be used to mark functions as deprecated .
"""
    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.

    Args:
        version (str): The version in which the deprecated functionality will be removed
        advice (str): Sentence explaining alternatives to the deprecated functionality.
    """
version
str
The version in which the deprecated functionality will be removed
The version in which the deprecated functionality will be removed
advice
str
Sentence explaining alternatives to the deprecated functionality.
Sentence explaining alternatives to the deprecated functionality .