Package schrodinger :: Package application :: Package jaguar :: Module output :: Class _Attribute
[hide private]
[frames] | no frames]

Class _Attribute

A small utility class to automate and regularize handling of attributes.

Instance Methods [hide private]
 
__init__(self, name, description="", datatype="", units=None, init=lambda: None, comparison=_SIMPLE, precision=None, renamed_from=None)
Arguments
 
__cmp__(self, other)
Provide for sorting based on the name.
 
summary(self, indent=0)
Provide a summary of the attribute suitable for a class docstring.
 
__repr__(self)
Method Details [hide private]

__init__(self, name, description="", datatype="", units=None, init=lambda: None, comparison=_SIMPLE, precision=None, renamed_from=None)
(Constructor)

 

Arguments

name (str)
    Attribute name

description (str)
    A description of the attribute appropriate for inclusion in the
    class docstring.

datatype (str)
    An indication of the data type, also for inclusion in the class
    docstring.

units (str)
    The units of the attribute; included in the docstring.

init (function)
    A function returning the initial value for the attribute. This
    must be a function so that things like empty lists and
    dictionaries aren't shared across multiple instances of
    JaguarOutputs.

comparison (object)
    The type of comparison to use for this attribute. If None, no
    comparison will be made.

precision (str)
    The name of the class attribute to use for the precision value
    in _LIST_PRECISION or _FLOAT_PRECISION comparisons.

renamed_from (str)
    If a name is provided, an "alias" property will be set up to
    ensure that a renamed attribute will still be available under
    the old name.