Package schrodinger :: Package application :: Package matsci :: Package genetic_optimization :: Module genetic_optimization :: Class Property
[hide private]
[frames] | no frames]

Class Property

object --+
         |
        Property

Manage a property to be used in a genetic optimization.

Instance Methods [hide private]
 
__init__(self, index=1, key=None, name=None, units=None, minimax=None, target=None, comparator=None, error=None, weight=1.0, positive=None, structure_property=False, patterns=None, summarize=None, class_kwargs=None)
Create an instance.
 
setAttributes(self, index=1, key=None, name=None, units=None, minimax=None, target=None, comparator=None, error=None, weight=1.0, positive=None, structure_property=False, patterns=None, summarize=None, class_kwargs=None)
Set some attributes for this class.
 
setClassKwargsAttr(self, class_kwargs_str)
Set the class_kwargs attr.
 
parsePropertyString(self, property_string)
Parse the attributes of this class from a string representation of the property specifications.
 
checkProperty(self)
Check this property instance.
 
__repr__(self)
Define a representation of the class.
 
__eq__(self, other_property)
Define an equality of the class.
bool
isStructureProperty(self)
Return True if this property is a structure property, False otherwise.
bool
isScriptProperty(self)
Return True if this property is a script property, False otherwise.
bool
isClassProperty(self)
Return True if this property is a class property, False otherwise.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
list
getPropertyStrings(property_lists)
Return property strings from the given property lists.
dict, str, or None
getKwargs(property_string, option_substrings, add_relative_paths=None)
Return kwargs of the given property options from the given property string.
str
rmKwargs(property_string, option_substrings)
Return a copy of the given property string with all of the given property option substrings removed.
str
getClassKwargsPropertySubOption(class_kwargs, kwarg_sep='>', kwargs_sep=',')
Return the class kwargs property sub-option string from the given class kwargs.
str
addKwargs(property_string, kwargs)
Add the given options to the given property string.
Class Variables [hide private]
  MAX = 'max'
  MIN = 'min'
  EQUALS = 'eq'
  GREATER_THAN = 'gt'
  LESS_THAN = 'lt'
  SUB_OPTIONS = ['index', 'key', 'name', 'units', 'minimax', 'ta...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, index=1, key=None, name=None, units=None, minimax=None, target=None, comparator=None, error=None, weight=1.0, positive=None, structure_property=False, patterns=None, summarize=None, class_kwargs=None)
(Constructor)

 

Create an instance.

Parameters:
  • index (int) - a numeric index used to refer to this Property instance, a default of 1 is used
  • key (str) - the schrodinger.structure.Structure property key to be optimized
  • name (str) - specify a name for the property, this name will be, for example used in any *log files, etc.
  • units (str) - enter the units that the property is in, for example eV, nm, etc.
  • minimax (str) - to minimize or maximize this property then set this option to the class constants MIN or MAX
  • target (float) - if instead of maximizing or minimizing the property, the genetic optimization is supposed to handle a specific value then enter that value using this option.
  • comparator (str) - specify here how the target value and computed values are to be compared, i.e. either the class constants EQUALS for =, GREATER_THAN for >, or LESS_THAN for <.
  • error (float) - if equality to a target value has been specified then this option allows the user to control the error bounds of the target value, if not specified then a default of 10% of the specified target value will be used.
  • weight (float) - specify the weight to use for this property, if the genetic optimization is to be run on several properties then the weight allows the user to bias the solution. This option can also be used to control a situation where more than a single property is desired and where those properties are quantified using different physical units such that the numbers might be orders of magnitude apart from one another, for example comparing eV and nm. A default of 1.0 is used.
  • positive (bool) - True if this property can only take on positive values, for example as in the area of a surface, False otherwise, for example as in temperature in Celcius. The default is False.
  • structure_property (bool) - True if this property is a structure property, False otherwise, i.e. if this property requires an external calculation, typically for physical observables
  • patterns (list) - contains SMARTS patterns
  • summarize (bool) - if True then print a summary of this property, False otherwise
  • class_kwargs (OrderedDict) - contains kwargs for class based evaluation of this property
Overrides: object.__init__

setAttributes(self, index=1, key=None, name=None, units=None, minimax=None, target=None, comparator=None, error=None, weight=1.0, positive=None, structure_property=False, patterns=None, summarize=None, class_kwargs=None)

 

Set some attributes for this class.

Parameters:
  • index (int) - a numeric index used to refer to this Property instance, a default of 1 is used
  • key (str) - the schrodinger.structure.Structure property key to be optimized
  • name (str) - specify a name for the property, this name will be, for example used in any *log files, etc.
  • units (str) - enter the units that the property is in, for example eV, nm, etc.
  • minimax (str) - to minimize or maximize this property then set this option to the class constants MIN or MAX
  • target (float) - if instead of maximizing or minimizing the property, the genetic optimization is supposed to handle a specific value then enter that value using this option.
  • comparator (str) - specify here how the target value and computed values are to be compared, i.e. either the class constants EQUALS for =, GREATER_THAN for >, or LESS_THAN for <.
  • error (float) - if equality to a target value has been specified then this option allows the user to control the error bounds of the target value, if not specified then a default of 10% of the specified target value will be used.
  • weight (float) - specify the weight to use for this property, if the genetic optimization is to be run on several properties then the weight allows the user to bias the solution. This option can also be used to control a situation where more than a single property is desired and where those properties are quantified using different physical units such that the numbers might be orders of magnitude apart from one another, for example comparing eV and nm. A default of 1.0 is used.
  • positive (bool) - True if this property can only take on positive values, for example as in the area of a surface, False otherwise, for example as in temperature in Celcius. The default is False.
  • structure_property (bool) - True if this property is a structure property, False otherwise, i.e. if this property requires an external calculation, typically for physical observables
  • patterns (list) - contains SMARTS patterns
  • summarize (bool) - if True then print a summary of this property, False otherwise
  • class_kwargs (OrderedDict) - contains kwargs for class based evaluation of this property

setClassKwargsAttr(self, class_kwargs_str)

 

Set the class_kwargs attr.

Parameters:
  • class_kwargs_str (str) - the class kwargs

parsePropertyString(self, property_string)

 

Parse the attributes of this class from a string representation of the property specifications. For example, 'index=1 key=r_matsci_Reduction_Potential_(eV) name=reduction units=eV target=1.28 comparator=eq error=0.05 weight=0.5' or 'index=2 key=r_matsci_Oxidation_Potential_(eV) name=oxidation units=eV minimax=max weight=2.5'

Parameters:
  • property_string (str) - the string representation of the property specifications
Raises:

__repr__(self)
(Representation operator)

 

Define a representation of the class.

Overrides: object.__repr__

isStructureProperty(self)

 

Return True if this property is a structure property, False otherwise.

Returns: bool
return True if this property is a structure property, False otherwise

isScriptProperty(self)

 

Return True if this property is a script property, False otherwise.

Returns: bool
return True if this property is a script property, False otherwise

isClassProperty(self)

 

Return True if this property is a class property, False otherwise.

Returns: bool
return True if this property is a class property, False otherwise

getPropertyStrings(property_lists)
Static Method

 

Return property strings from the given property lists.

Parameters:
  • property_lists (list) - contains lists of property specifications
Returns: list
contains string representations of the property specifications

getKwargs(property_string, option_substrings, add_relative_paths=None)
Static Method

 

Return kwargs of the given property options from the given property string.

Parameters:
  • property_string (str) - the string representation of the property specifications, containing options as '<option_substring>=<value>'
  • option_substrings (list or str) - contains the option substrings for the needed values, a single occurence or list of occurences may be passed
  • add_relative_paths (list) - contains options for which relative paths should be added, such relative paths might be needed for correctly parallelizing the evaluation stage of the genetic optimization as they will be needed to copy otherwise shared files into local subdirectories
Returns: dict, str, or None
the extracted dictionary of kwargs or single kwarg depending on the input option_substrings or None if nothing is found

rmKwargs(property_string, option_substrings)
Static Method

 

Return a copy of the given property string with all of the given property option substrings removed.

Parameters:
  • property_string (str) - the string representation of the property specifications, containing options as '<option_substring>=<value>'
  • option_substrings (list) - contains the option substrings to be removed
Returns: str
the string representation of the property specifications less the options substrings that were to be removed

getClassKwargsPropertySubOption(class_kwargs, kwarg_sep='>', kwargs_sep=',')
Static Method

 

Return the class kwargs property sub-option string from the given class kwargs.

Parameters:
  • class_kwargs (dict) - contains key-value pairs for the class
  • kwarg_sep (str) - kwarg separator
  • kwargs_sep (str) - kwargs separator
Returns: str
the class kwargs property sub-option string

addKwargs(property_string, kwargs)
Static Method

 

Add the given options to the given property string.

Parameters:
  • property_string (str) - the string representation of the property specifications, containing options as '<option_substring>=<value>'
  • kwargs (dict) - key-value option pairs to add to the property string
Returns: str
the string representation of the property specifications containin the new options

Class Variable Details [hide private]

SUB_OPTIONS

Value:
['index',
 'key',
 'name',
 'units',
 'minimax',
 'target',
 'comparator',
 'error',
...