schrodinger.application.mopac.utils module¶
- schrodinger.application.mopac.utils.open_file(basename, suffix)[source]¶
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.
- schrodinger.application.mopac.utils.make_scratch_dir(tmpdir, basename)[source]¶
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.
- schrodinger.application.mopac.utils.run_cleanup(results, start_dir, scr_dir, jobname, save_output_file, scratch_cleanup)[source]¶
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.
- schrodinger.application.mopac.utils.is_mopac_file(filename)[source]¶
Determine if the file provided is a MOPAC input file or not. Returns True or False.