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

Class TextParser

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.

Nested Classes [hide private]
  _output_class
Instance Methods [hide private]
 
__init__(self, file_iter=None, jaguar_output=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.
Class Variables [hide private]
  callback = {}
  first_line_re = re.compile("^Job \S+ started on (\S+) at (\w.*...
Method Details [hide private]

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

 

Parameters

file_iter (iterator returning lines of Jaguar output file)

jaguar_output (JaguarOutput instance)
    If provided, this instance will be populated by the parse
    method. Otherwise, a new instance will be created and returned
    by that method.

_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.

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, if
    a JaguarOutput instance was provided to the constructor that
    instance will be used. Otherwise, a new instance will be created
    and returned.


Class Variable Details [hide private]

first_line_re

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