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, to_remove_in)¶ Parameters: - msg (str) – deprecation message to isse
- to_remove_in (XXXX-X) – Schrodinger core suite release version
-
schrodinger.utils.deprecation.
deprecate_module
(module_name, to_remove_in, 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, to_remove_in=None, replacement=None, msg=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
- msg (str) – specific message if default message is not desired
-
schrodinger.utils.deprecation.
enable_deprecated
()¶ Enables deprecated imports/functions within managed context