schrodinger.application.mopac.results2012 module

This module parses and stores the results of a MOPAC2012 calculation. A MopacResults2012 class is populated with data from the MOPAC2012 output files using a text parser.

class schrodinger.application.mopac.results2012.Mopac2012TextParser(file_iter)

Bases: future.types.newobject.newobject

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.

callbacks = OrderedDict([(<_sre.SRE_Pattern object at 0x8438250>, <function func>), (<_sre.SRE_Pattern object at 0xa93d9b0>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object at 0xc9615d0>, <function func>), (<_sre.SRE_Pattern object at 0xcc1ccf0>, <function func>), (<_sre.SRE_Pattern object at 0xcc1d0c0>, <function func>), (<_sre.SRE_Pattern object at 0xcc1d470>, <function func>), (<_sre.SRE_Pattern object at 0xb2082a0>, <function func>), (<_sre.SRE_Pattern object at 0xcc1d820>, <function func>), (<_sre.SRE_Pattern object at 0x8877e10>, <function func>), (<_sre.SRE_Pattern object at 0xb31d8f0>, <function func>), (<_sre.SRE_Pattern object at 0xce0b650>, <function func>), (<_sre.SRE_Pattern object at 0x8878150>, <function func>), (<_sre.SRE_Pattern object at 0xbbd6f30>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object at 0xada1a90>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>), (<_sre.SRE_Pattern object>, <function func>)])
parse()

Loop over self.file_iter and trigger the callbacks.

exception schrodinger.application.mopac.results2012.MopacBasisError1

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacBasisError2

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacBasisError3

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacBasisError4

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacBasisError5

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacNumericalError

Bases: exceptions.Exception

exception schrodinger.application.mopac.results2012.MopacPropertyError

Bases: exceptions.Exception

class schrodinger.application.mopac.results2012.MopacResults2012

Bases: schrodinger.application.mopac.mopac_results.MopacResults

A class to parse and store the results of a MOPAC2012 calculation.

get_error_text()

Needed to be consistent with legacy code

method
output_file
populate_from_file(filename)

Parse “filename” containing MOPAC2012 output data.

set_final_structure(structure, filename)

Compile parsed results into the structure.properties dictionary.

set_method(value)
set_output_file(value)
set_status(value)
statusOk()

Needed to be consistent with legacy code

structure
write_vis_files(jobname, nplot, gridres, gridext)

This function will call the Fortran routines to generate the 3D data and .vis files for plotting surfaces.

Parameters:nplot (int) – number of MOs to plot around HOMO/LUMO gap.
schrodinger.application.mopac.results2012.callback(regex)

This decorator is just a convenient way to populate the callbacks dictionary in the Mopac2012TextParser. The associated functions themselves are not actually decorated.

schrodinger.application.mopac.results2012.check_memory_use(nvals, name)

Check memory requirment for a long list of floats. Print message if size exceeds MEMORY_WARNING.

schrodinger.application.mopac.results2012.fortfloat(val)

Convert a floating point number in Fortran notation to a regular float.

schrodinger.application.mopac.results2012.func(props, match, it)
schrodinger.application.mopac.results2012.update_props(props, key, value, precision=5)

Update the props dictionary with the key-value pair, performing consistency checks if the key already exists.