deprecation#

Implements helper functions for deprecation handling.

deprecated_alias(old2new[, read_only, ...])

Decorator function for deprecating renamed class traits.

acoular.deprecation.deprecated_alias(old2new, read_only=False, removal_version='')#

Decorator function for deprecating renamed class traits.

Replaced traits should no longer be part of the class definition and only mentioned in this decorator’s parameter list. The replacement trait has to be defined in the updated class and will be mapped to the deprecated name via this function.

Parameters:
old2new: dict

Dictionary containing the deprecated trait names as keys and their new names as values.

read_only: bool or list

If True, all deprecated traits will be “read only”. If False (default), all deprecated traits can be read and set. If list, traits whose names are in list will be “read only”.

removal_version: string or dict

Adds the acoular version of trait removal to the deprecation message. If a non-empty string, it will be interpreted as the acoular version when all traits in the list will be deprecated. If a dictionary, the keys are expected to be trait names and the values are the removal version as strings.