Package schrodinger :: Package tasks :: Module parameters
[hide private]
[frames] | no frames]

Module parameters

Classes [hide private]
  AbstractParam
Base class for all Param classes.
  ParamMeta
This metaclass modifies the creation of AbstractCompoundParam instances in the following ways:
  AbstractCompoundParam
A collection of Params that itself is a Param.
  ParamContainer
This is a base class for regular objects (not desriptors) which will hold params.
  FloatParam
  IntParam
  StringParam
  BoolParam
  DictParam
  ListParam
Functions [hide private]
 
obj_params_to_dict(obj)
Takes any object that contains params and returns a dictionary of all the param values keyed by param name.
 
obj_params_from_dict(obj, param_dict)
Updates the values of all params in an object using the values specified in a dictionary of values keyed by param name.
 
get_obj_param_value(obj, param)
Enables access to a param value on an object via an abstract param reference.
 
set_obj_param_value(obj, param, value)
Set the value of a param on an instance by specifying the instance, an abstract param reference, and the value.
 
get_obj_params(obj)
Variables [hide private]
  __package__ = 'schrodinger.tasks'
Function Details [hide private]

obj_params_to_dict(obj)

 

Takes any object that contains params and returns a dictionary of all the param values keyed by param name. Compound params are represented as nested dictionaries.

Parameters:
  • obj (object) - an object that has one or more params as member variables.

obj_params_from_dict(obj, param_dict)

 

Updates the values of all params in an object using the values specified in a dictionary of values keyed by param name.

Parameters:
  • obj (object) - an object that has one or more params as member variables.
  • param_dict (dict) - a dictionary of param names and desired values. Any entry in the dictionary which does not correspond to a param on the object will result in a ValueError being raised.

get_obj_param_value(obj, param)

 

Enables access to a param value on an object via an abstract param
reference. The abstract reference is the one which begins with a class
rather than an instance. Example, for an instance a1 of class Atom:

    x = get_obj_param_value(a1, Atom.coord.x)

x should have the value of a1.coord.x

@param obj: the instance from which to get the param value
@param param: an abstract Param reference

@type param: AbstractParam

set_obj_param_value(obj, param, value)

 

Set the value of a param on an instance by specifying the instance, an abstract param reference, and the value. Example, for an instance a1 of class Atom:

set_obj_param_value(a1, Atom.coord.x, 5)

This should set the value of a1.coord.x to 5.

Parameters:
  • obj - the instance from which to get the param value
  • param (AbstractParam) - an abstract Param reference
  • value - the value to set