Package schrodinger :: Package application :: Package desmond :: Package packages :: Module analysis :: Class _CustomCalc
[hide private]
[frames] | no frames]

Class _CustomCalc

         object --+        
                  |        
               dict --+    
                      |    
collections.OrderedDict --+
                          |
                         _CustomCalc


An instance of this class will store custom calculation requests (keys) and
results (values). Each request is represented as a calculation ID (or CID
for short). If the same calculation is requested by different analyzers,
using the same CID can avoid duplicate calculation. A CID must be a hashable
object of any type, whereas the results (values) can just be of any type.

A CID can be either a callable or noncallable object. If it's callable, the
C{GeomCalc} object will call it with the following arguments:

  callable_object(data, pbc, fr, self)

where C{data} is the current value corresponding to this CID, C{pbc} is a
L{Pbc} object, C{fr} is a trajectory frame (L{traj.Frame}), and C{self} is
this L{_CustomCalc} object. This function should return a new value to
replace the old one.

If a CID is noncallable object, the analyzer(s) that needs the data is
responsible to update the data from the current trajectory frame. Note that
if you have more than one analyzers reading the data, you have to somehow
ensure that the data is updated only once for each trajectory frame.

Instance Methods [hide private]
 
calc(self, pbc, fr)

Inherited from collections.OrderedDict: __delitem__, __eq__, __init__, __iter__, __ne__, __reduce__, __repr__, __reversed__, __setitem__, clear, copy, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from dict: __cmp__, __contains__, __ge__, __getattribute__, __getitem__, __gt__, __le__, __len__, __lt__, __new__, __sizeof__, get, has_key

Inherited from object: __delattr__, __format__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from collections.OrderedDict: fromkeys

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__