-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Alex Zech edited this page Sep 26, 2017
·
5 revisions
-
If it doesn't exist yet, create
qcname.py
whereqcname
is the label for the quantum chemistry software. -
Create a class for every method derived from the CCParser class
QCMethod
, for instance:class SCF(QCMethod): def __init__(self): super().__init__() self.hooks = {}
-
Implement a new parsing function. All parsing functions must have two arguments:
-
l_index
- the line index -
data
- the file content (file.readlines()
)
Such a function could look like this:
def scf_energy(self, l_index, data): self.add_variable(self.func_name(), VarNames.scf_energy) return float(data[l_index].split()[-1])
The first line after the
def
statement is necessary to register the function's name to the list of parsable functions. -
-
Create a hook for the new function. The hook identifies the same line as the desired quantity or a line close to it. The entry into the
hooks
dictionary is created as follows: Use the function's name as the key and the identifying string as the value, for instance:self.hooks = {"scf_energy": "SCF Energy in (a.u.): "}
-
In
QCBase.py
, add your function to the classVarNames
.