-
Notifications
You must be signed in to change notification settings - Fork 2
Home
-
The parsing functions for every software are collected in one file.If it doesn't exist yet, create
ccname.py
whereccname
is the label for the computational chemistry software. It will be called fromParser.load_methods()
inParser.py
. -
Create a class for every method (or logical unit) derived from the CCParser class
QCMethod
, for instance:class SCF(QCMethod): def __init__(self): super().__init__() self.hooks = {}
-
Parsing functions should be member functions of a method class. All parsing functions must have two arguments:
-
i
- the line index -
data
- the file content (file.readlines()
)
Such a function could look like this:
@var_tag(VarNames.scf_nrg) def my_scf_energy(self, i, data): return float(data[l_index].split()[-1])
The
var_tag
decorator is necessary to register the function's name to the list of parseable 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 = {"my_scf_energy": "SCF Energy in (a.u.): "}
-
In
QCBase.py
, add the target of your function to the classVarNames
, for instance:scf_nrg = "scf_energy"