Package schrodinger :: Package application :: Package mopac
[hide private]
[frames] | no frames]

Package mopac

Functions for running MOPAC calculations and parsing results.

Classes [hide private]
  MopacCalculationError
  MopacCalculation
A class for running MOPAC calculations.
  MopacResults
A class to store MOPAC results.
Functions [hide private]
 
_make_scratch_dir(tmpdir, basename)
Make a separate directory for the job to enable easy cleanup.
 
_open_file(basename, suffix)
Open a file with a unique name based on basename and suffix in the form "basename-<index>.suffix", where "<index>" is an integer that is incremented until the file can be created.
 
_run_locally(inputfile, method=None, structure=None)
Run a MOPAC calculation in the local directory.
 
is_mopac_file(filename)
Determine if the file provided is a MOPAC input file or not.
 
get_mopac_jobname(pathname)
Get the MOPAC jobname that will be used.
 
run(inputfile, jobname=None, tmpdir='', save_output_file=False, scratch_cleanup='remove')
Run a MOPAC job from an existing MOPAC input file in a scratch directory and clean up afterwards.
 
_cleanup_external(inputfile, start_dir)
If the input file has a relative path specification for an EXTERNAL file, rewrite it to the local dir, then copy the original file to the current directory.
 
_run_cleanup(results, start_dir, scr_dir, jobname, save_output_file, scratch_cleanup)
Cleanup from a subdirectory run.
 
calculate(structure, jobname=None, method='RM1', minimize=True, kwdict=None, keywords='', tmpdir='', input_file=False, save_output_file=False, scratch_cleanup='remove')
Run a MOPAC calculation without explicitly setting up a MopacCalculation object.
 
get_error_text()
Get the error text set during the main MOPAC calculation.
Variables [hide private]
  _logger = log.get_logger("schrodinger.application.mopac")
  _method_keywords = ['AM1', 'MNDO', 'MNDOD', 'PM3', 'RM1']
  _methods = set(['AM1', 'MNDO', 'MNDOD', 'PM3', 'RM1'])
  _external_re = re.compile(r'(?i)EXTERNAL *= *(\S+)')
  AM1 = 'AM1'
  MNDO = 'MNDO'
  MNDOd = 'MNDOD'
  PM3 = 'PM3'
  REMOVE = 'remove'
  RM1 = 'RM1'
  SAVE = 'save'
  ZIP = 'zip'
  __package__ = 'schrodinger.application.mopac'
Function Details [hide private]

_make_scratch_dir(tmpdir, basename)

 

Make a separate directory for the job to enable easy cleanup.

Parameters:
  • basename (str) - A name that will be used to generate a scratch dir name. The name used will either be basename or basename.1, basename.2, etc.
  • tmpdir (str) - A directory that will hold the scratch directory.
Returns:
The name of the directory that was created.

_open_file(basename, suffix)

 

Open a file with a unique name based on basename and suffix in the form "basename-<index>.suffix", where "<index>" is an integer that is incremented until the file can be created. Return the opened file object.

is_mopac_file(filename)

 

Determine if the file provided is a MOPAC input file or not. Returns True or False.

run(inputfile, jobname=None, tmpdir='', save_output_file=False, scratch_cleanup='remove')

 

Run a MOPAC job from an existing MOPAC input file in a scratch directory and clean up afterwards.

Parameters:
  • jobname (str) - An alternate jobname. If None, the jobname will be determined by the function get_mopac_jobname().
  • inputfile (str) - A MOPAC input file.
  • tmpdir (str) - A directory in which a scratch directory based on the inputfile name will be created.
  • save_output_file (bool) - If True, copy the output file from the scratch dir back to the starting directory.
  • scratch_cleanup (enum) - If REMOVE, simply remove the scratch dir at the end of the job; if ZIP, create a zip file of the scratch directory contents; if SAVE, do no cleanup.
Returns:
A MopacResults object.

_run_cleanup(results, start_dir, scr_dir, jobname, save_output_file, scratch_cleanup)

 

Cleanup from a subdirectory run.

This will completely nuke the scratch dir and cd to the start_dir.

Parameters:
  • results (MopacResults) - A MopacResults object, in which output filename and zipped_output filenames are stored if available.
  • start_dir (str) - The launch directory for the job.
  • scr_dir (str) - The scratch directory for the job as an absolute path.
  • jobname (str) - The base job name.
  • save_output_file (bool) - If True, copy the output file from the scratch dir back to the starting directory.
  • scratch_cleanup (enum) - If REMOVE, simply remove the scratch dir at the end of the job; if ZIP, create a zip file of the scratch directory contents; if SAVE, do no cleanup.

calculate(structure, jobname=None, method='RM1', minimize=True, kwdict=None, keywords='', tmpdir='', input_file=False, save_output_file=False, scratch_cleanup='remove')

 

Run a MOPAC calculation without explicitly setting up a MopacCalculation object.

All keyword arguments are passed on to the MopacCalculation constructor.

get_error_text()

 

Get the error text set during the main MOPAC calculation.

If there is no error text, returns the empty string.