schrodinger.utils.deprecation module¶
Deprecation handling
Copyright Schrodinger LLC, All Rights Reserved.
-
exception
schrodinger.utils.deprecation.
DeprecationError
¶ Bases:
RuntimeError
Exception indicating API deprecation
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
schrodinger.utils.deprecation.
raise_deprecation_error
(msg, last_release)¶
-
schrodinger.utils.deprecation.
deprecate_module
(module_name, last_release, replacement=None)¶ Raises a deprecation error (or only prints a warning when USE_DEPRECATED is enabled), indicating to the caller that the import should be removed, and updated to a new module if applicable.
Parameters: - old_name (str) – deprecated module name
- new_name (module) – current module to import
-
schrodinger.utils.deprecation.
deprecated
(func, last_release=None, replacement=None, *args, **kwargs)¶ Raises a deprecation error (or only prints a warning when USE_DEPRECATED is enabled), indicating to the caller that the decorated call should be removed, and updated to a new function/method call if applicable.
Parameters: - func (function) – deprecated function/method
- replacement (function) – current function/method to use
-
schrodinger.utils.deprecation.
enable_deprecated
()¶ Enables deprecated imports/functions within managed context