fsl.utils.deprecated

This module provides the deprecated() function, a simple decorator for deprecating functions and methods.

The warn() function can also be called directly, to emit a DeprecationWarning

fsl.utils.deprecated.resetWarningCache()[source]

Clears the internal warning cache, so that the same line of code may emit another deprecation warning.

fsl.utils.deprecated.warn(name, vin=None, rin=None, msg=None, stacklevel=1)[source]

Emit a deprecation warning.

Parameters
  • name – Name of the thing (class, function, module, etc) that is deprecated.

  • vin – Optional version - the warning message will mention that the function is deprecated from this version.

  • rin – Optional version - the warning message will mention that the function will be removed in this version.

  • msg – Optional message to use in the warning.

  • stacklevel – How far up the stack the calling code is.

fsl.utils.deprecated.deprecated(vin=None, rin=None, msg=None)[source]

Decorator to mark a function or method as deprecated. A DeprecationWarning is raised via the standard warnings module.

Parameters
  • vin – Optional version - the warning message will mention that the function is deprecated from this version.

  • rin – Optional version - the warning message will mention that the function will be removed in this version.

  • msg – Optional message to use in the warning.