atomate.qchem package


atomate.qchem.database module

class atomate.qchem.database.QChemCalcDb(host='localhost', port=27017, database='qchem', collection='tasks', user=None, password=None)

Bases: atomate.utils.database.CalcDb

Class to help manage database insertions of QChem drones

__init__(host='localhost', port=27017, database='qchem', collection='tasks', user=None, password=None)

Initialize self. See help(type(self)) for accurate signature.

build_indexes(indexes=None, background=True)

Build the indexes.

indexes (list): list of single field indexes to be built. background (bool): Run in the background or not.
TODO: make sure that the index building is sensible and check for
existing indexes.

atomate.qchem.drones module

class atomate.qchem.drones.QChemDrone(runs=None, additional_fields=None)

Bases: pymatgen.apps.borg.hive.AbstractDrone

A QChem drone to parse QChem calculations and insert an organized, searchable entry into the database.

__init__(runs=None, additional_fields=None)

Initialize a QChem drone to parse qchem calculations Args:

runs (list): Naming scheme for multiple calcuations in one folder additional_fields (dict): dictionary of additional fields to add to output document
assimilate(path, input_file, output_file, multirun)

Parses qchem input and output files and insert the result into the db.


path (str): Path to the directory containing output file input_file (str): base name of the input file(s) output_file (str): base name of the output file(s) multirun (bool): Whether the job to parse includes multiple

calculations in one input / output pair.
d (dict): a task dictionary
filter_files(path, file_pattern)

Find the files that match the pattern in the given path and return them in an ordered dictionary. The searched for files are filtered by the run types defined in self.runs.

path (string): path to the folder file_pattern (string): base files to be searched for
OrderedDict of the names of the files to be processed further. The key is set from list of run types: self.runs
generate_doc(dir_name, qcinput_files, qcoutput_files, multirun)
static get_valid_paths(path)

Checks if path contains valid data for assimilation, and then returns the valid paths. The paths returned can be a list of directory or file paths, depending on what kind of data you are assimilating. For example, if you are assimilating VASP runs, you are only interested in directories containing vasprun.xml files. On the other hand, if you are interested converting all POSCARs in a directory tree to cifs for example, you will want the file paths.

path: input path as a tuple generated from os.walk, i.e.,
(parent, subdirs, files).
List of valid dir/file paths for assimilation
static post_process(d)

Post-processing for various files other than the QChem input and output files. Currently only looks for custodian.json. Modify this if other files need to be processed.

static process_qchem_multirun(input_files, output_files)

Process a QChem run which is known to include multiple calculations in a single input/output pair.

static process_qchemrun(taskname, input_file, output_file)

Process a QChem calculation, aka an input/output pair.

schema = {'input': {'job_type', 'initial_molecule'}, 'output': {'job_type', 'initial_molecule'}, 'root': {'chemsys', 'cputime', 'input', 'output', 'dir_name', 'smiles', 'calcs_reversed', 'walltime', 'pointgroup', 'formula_anonymous', 'formula_pretty'}}

Sanity check, aka make sure all the important keys are set. Note that a failure to pass validation is unfortunately unlikely to be noticed by a user.

atomate.qchem.powerups module

Module contents