Package schrodinger :: Package application :: Package mopac :: Module results2012 :: Class Mopac2012TextParser
[hide private]
[frames] | no frames]

Class Mopac2012TextParser

object --+
         |
        Mopac2012TextParser

Parser for the MOPAC2012 .out and .aux files. Using decorators, the callback() function below populates the "callbacks" dictionary in this class with key-value pairs of the form (regex,func) where "regex" is a regular expression to catch patterns in the output file, and "func" is the callback function which is triggered when the regex is matched.

In this way, each specific callback is triggered by a given pattern such as 'HOMO LUMO ENERGIES \(EV\) =', and the callback function processes the matched lines.

Note that multiple regex's can be associated with a given callback function by associating it with two or more decorators. In this way, the same callback can be triggered multiple times. e.g. for both the .aux and .out files, perhaps for consistency checking etc.

Typically, however, only one regex is associated with each callback so that data for a given property is grepped from either the .out file OR the .aux file, but not both.

Instance Methods [hide private]
 
__init__(self, filename)
x.__init__(...) initializes x; see help(type(x)) for signature
 
parse_file(self, properties)
Loop over self.file_iter and trigger the callbacks.

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

Class Variables [hide private]
  callbacks = OrderedDict([(<_sre.SRE_Pattern object at 0xb9d448...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

callbacks

Value:
OrderedDict([(<_sre.SRE_Pattern object at 0xb9d4480>, <function func a\
t 0x7f5d9b9bb398>), (<_sre.SRE_Pattern object at 0xb771650>, <function\
 func at 0x7f5d9b9bb398>), (<_sre.SRE_Pattern object at 0x7f5d9bbc8ab0\
>, <function func at 0x7f5d9b9bb320>), (<_sre.SRE_Pattern object at 0x\
b771060>, <function func at 0x7f5d9b9bb410>), (<_sre.SRE_Pattern objec\
t at 0xb772060>, <function func at 0x7f5d9b9bb488>), (<_sre.SRE_Patter\
n object at 0xb772400>, <function func at 0x7f5d9b9bb500>), (<_sre.SRE\
_Pattern object at 0xb7731b0>, <function func at 0x7f5d9b9bb578>), (<_\
...