schrodinger.application.matsci.codeutils module

Module for utilities related to code maintenance

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.codeutils.check_moved_variables(var_name, moved_variables)[source]

Check if the target variable has been moved, and if yes, post a warning about it and return the variable in the new module Raises AttributeError if a moved variable isn’t found.

Parameters
  • var_name (str) – Name of the target variable

  • moved_variables (tuple) – Tuple of tuples. Each inner tuple has a format of (module, remove_release, variables), where module is the new module name, remove_release is the release in which the link will stop working, and variables are the set of variables that were moved

Raises

AttributeError – If var_name is not a moved variable

Return type

Any

Returns

The moved variable

schrodinger.application.matsci.codeutils.deprecate(func, to_remove_in=None, replacement=None, *args, **kwargs)[source]

Post a warning about the function being deprecated

Parameters
  • func (callable) – The function that is deprecated

  • to_remove_in (str) – The release in which the function will be removed

  • replacement (callable) – The function to call instead