pymopac package
Submodules
pymopac.classes module
pymopac.helpers module
Module contents
PyMOPAC: A Python interface for MOPAC calculations.
This package provides tools and utilities for working with MOPAC, a semi-empirical quantum chemistry program.
- class MopacInput(geometry, model: str = 'PM7', custom_header: str = '', comment: str = '#', path=False, addHs: bool = True, preopt: bool = True, verbose: bool = False, stream: bool = False, plot: bool = False, aux: bool = True)[source]
Bases:
BaseInputClass that sets up the input file for a MOPAC calculation.
- geometry:
pure xyz block
SMILES (str)
rdkit Mol
- model: str
all supported MOPAC keywords, e.g. AM1, PM6, …
- custom_header: str
custom string that is attached to other header keywords
- comment: str
second line in the input file
- path:
if False, a dir is created under /tmp/, else under the given str
- AddHs: bool
calls AddHs on the mol object
- preopt: bool
uses MMFF to optimize the mol structure
- verbose: bool
if True, prints additional class internal statements
- stream: bool
if True, streams the outfile to stdout
- plot: bool
if True, plots progress via matplotlib
- + run()
- runs MOPAC as a subprocess
- returns MopacOutput class
- + getInpFile()
- returns the MOPAC input as a string
- class MopacOutput(outfile: str, stdout=None, stderr=None, aux: str | None = None)[source]
Bases:
BaseOutputMain Output class, calls parsers and structures outputs
Custom parsers can be written, inherinting from input.BaseParser. Every Output class has a list at self.parser which, custom parsers can simply be added. If a parser has been added after Output initialization, parsing can be redone using Output.parseAll() By convention, custom parsers are able to set attributes on the Ouput class by having the Output passed as an argument at parse time.
a .aux file is passed, as is standard when creating the output via the MopacInput.run() method. Using this, all properties can be parsed in an unsupervised manner. Results of this can be found under self.auxDict