deprecator¶
Class for recording and reporting deprecations
  | 
Class to make decorator marking function or method as deprecated  | 
Error for expired deprecation  | 
Deprecator¶
- class nibabel.deprecator.Deprecator(version_comparator: ~typing.Callable[[str], int], warn_class: type[Warning] = <class 'DeprecationWarning'>, error_class: type[Exception] = <class 'nibabel.deprecator.ExpiredDeprecationError'>)¶
 Bases:
objectClass to make decorator marking function or method as deprecated
The decorated function / method will:
Raise the given warning_class warning when the function / method gets called, up to (and including) version until (if specified);
Raise the given error_class error when the function / method gets called, when the package version is greater than version until (if specified).
- Parameters:
 - version_comparatorcallable
 Callable accepting string as argument, and return 1 if string represents a higher version than encoded in the version_comparator, 0 if the version is equal, and -1 if the version is lower. For example, the version_comparator may compare the input version string to the current package version string.
- warn_classclass, optional
 Class of warning to generate for deprecation.
- error_classclass, optional
 Class of error to generate when version_comparator returns 1 for a given argument of
untilin the__call__method (see below).
ExpiredDeprecationError¶
- class nibabel.deprecator.ExpiredDeprecationError¶
 Bases:
RuntimeErrorError for expired deprecation
Error raised when a called function or method has passed out of its deprecation period.
- __init__(*args, **kwargs)¶