Package schrodinger :: Package application :: Package jaguar :: Module textparser :: Class TextParser
[hide private]
[frames] | no frames]

Class TextParser

object --+
         |
        TextParser
Known Subclasses:

A parser to create a JaguarOutput object from a Jaguar output file.

The basic organization of this parser is that of a number of line processing callback functions triggered by regular expressions.

Instance Methods [hide private]
 
__init__(self, jaguar_output, file_iter=None)
Parameters
 
_newResults(self, jo)
Add a new results object for a new geometry or scan step.
 
endGeopt(self, jo)
Clean up at the end of a geopt step.
 
endScan(self, jo)
Clean up at the end of a scan step.
 
endIRC(self, direction)
Set state indicating the end of an IRC step and its direction.
 
parse(self, file_iter=None, jaguar_output=None)
Parse the provided file iterator.
 
_finalize(self, jo)
Actions to be taken at the end of the file.

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

Class Variables [hide private]
  callback = {None: {re.compile(r'ERROR *(\d+)?: fatal error( --...
  first_line_re = re.compile(r'^Job \S+ started on (\S+) at (\w....
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, jaguar_output, file_iter=None)
(Constructor)

 

Parameters

file_iter (iterator returning lines of Jaguar output file)

jaguar_output (JaguarOutput instance)

Overrides: object.__init__

_newResults(self, jo)

 

Add a new results object for a new geometry or scan step.

Caller is responsible for storing jo._results before calling this if it needs to be kept. For example, storing results from a geometry in a geopt sequence of results.

endGeopt(self, jo)

 

Clean up at the end of a geopt step.

Adds the current results to the geopt list and creates a new current results object if appropriate.

endScan(self, jo)

 

Clean up at the end of a scan step.

Adds the current results to the scan list and creates a new current results object. Or, if this a relaxed scan, archives the geopt steps to the scan list and creates an empty geopt_step list.

endIRC(self, direction)

 

Set state indicating the end of an IRC step and its direction.

direction (str)
    Must be 'Forward' or 'Reverse'.

parse(self, file_iter=None, jaguar_output=None)

 

Parse the provided file iterator.

Return a JaguarOutput instance populated with properties parsed from
the output file.

Parameters

file_iter (iterator returning lines of Jaguar output)

jaguar_output (JaguarOutput instance)
    If jaguar_output is provided, that instance will be populated
    with the properties parsed from the output file. Otherwise,
    the object provided to the TextParser constructor will be used.


Class Variable Details [hide private]

callback

Value:
{}

first_line_re

Value:
re.compile(r'^Job \S+ started on (\S+) at (\w.*)$')