neuralib.util.deprecation.deprecated_aliases

neuralib.util.deprecation.deprecated_aliases(**aliases)[source]

Mark deprecated argument names and map them to new argument names in a function

This decorator allows you to support old argument names while transitioning to new ones. It will raise a DeprecationWarning if the old argument name is used and will automatically map the value to the new argument name.

Parameters:

aliases (str) – mapping of old argument names to new argument names.

Returns:

Decorated function with support for deprecated argument names.

Raises:
  • RuntimeError – If a new argument name does not exist in the function’s signature.

  • ValueError – If both old and new argument names are provided simultaneously.