atomate.vasp package

Subpackages

Submodules

atomate.vasp.config module

atomate.vasp.database module

class atomate.vasp.database.MMBoltztrapDb(host, port, database, collection, user, password)

Bases: atomate.utils.database.MMDb

class atomate.vasp.database.MMVaspDb(host=u'localhost', port=27017, database=u'vasp', collection=u'tasks', user=None, password=None)

Bases: atomate.utils.database.MMDb

Class to help manage database insertions of Vasp drones

__init__(host=u'localhost', port=27017, database=u'vasp', collection=u'tasks', user=None, password=None)
build_indexes(indexes=None, background=True)

Build the indexes.

Args:
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.
get_band_structure(task_id)
get_dos(task_id)
insert_gridfs(d, collection=u'fs', compress=True, oid=None)

Insert the given document into GridFS.

Args:
d (dict): the document collection (string): the GridFS collection name compress (bool): Whether to compress the data or not oid (ObjectId()): the _id of the file; if specified, it must not already exist in GridFS
Returns:
file id, the type of compression used.
reset()

atomate.vasp.drones module

class atomate.vasp.drones.VaspDrone(runs=None, parse_dos=False, compress_dos=False, bandstructure_mode=False, compress_bs=False, additional_fields=None, use_full_uri=True)

Bases: pymatgen.apps.borg.hive.AbstractDrone

pymatgen-db VaspToDbTaskDrone with updated schema and documents processing methods. Please refer to matgendb.creator.VaspToDbTaskDrone documentation.

__init__(runs=None, parse_dos=False, compress_dos=False, bandstructure_mode=False, compress_bs=False, additional_fields=None, use_full_uri=True)
as_dict()
assimilate(path)

Parses vasp runs(vasprun.xml file) and insert the result into the db.

Args:
path (str): Path to the directory containing vasprun.xml file
Returns:
tuple of (task_id, task_doc dict)
check_keys(d)

Sanity check. Make sure all the important keys are set

filter_files(path, file_pattern=u'vasprun.xml')

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. e.g. [“relax1”, “relax2”]. Only 2 schemes of the file filtering is enabled: searching for run types in the list of files and in the filenames. Modify this method if more sophisticated filtering scheme is needed.

Args:
path (string): path to the folder file_pattern (string): files to be searched for
Returns:
OrderedDict of the names of the files to be processed further. The key is set from list of run types: self.runs
classmethod from_dict(d)
generate_doc(dir_name, vasprun_files, outcar_files)

Adapted from matgendb.creator.generate_doc

get_basic_processed_data(d)

return processed data such as vbm, cbm, gap etc.

get_task_doc(path)

Adapted from matgendb.creator Get the entire task doc from the vasprum.xml and the OUTCAR files in the path. Also adds some post-processed info.

Args:
path (str): Path to the directory containing vasprun.xml and OUTCAR files
Returns:
The dictionary to be inserted into the db
get_valid_paths(path)

Required by the AbstractDrone. Update this and use it to further filter the files to be assimilated.

post_process(dir_name, d)

Simple post-processing for various files other than the vasprun.xml and OUTCAR. Looks for files: Transformations.json and custodian.json. Modify this if other output files need to be processed.

Args:
dir_name:
The dir_name.
d:
Current doc generated.
process_outcar(dir_name, filename)

Process the outcar file

process_vasprun(dir_name, taskname, filename)

Adapted from matgendb.creator

Process a vasprun.xml file.

schema = {u'input': set([u'pseudo_potential', u'hubbards', u'xc_override', u'potcar_spec', u'is_hubbard', u'structure', u'is_lasph']), u'calcs_reversed': set([u'dir_name', u'run_type', u'task', u'input', u'formula_anonymous', u'nelements', u'vasp_version', u'nsites', u'composition_reduced', u'completed_at', u'formula_reduced_abc', u'composition_unit_cell', u'output', u'formula_pretty', u'has_vasp_completed', u'elements']), u'root': set([u'calcs_reversed', u'elements', u'input', u'composition_reduced', u'formula_pretty', u'nelements', u'nsites', u'chemsys', u'analysis', u'completed_at', u'state', u'formula_reduced_abc', u'run_stats', u'composition_unit_cell', u'dir_name', u'output', u'formula_anonymous', u'schema']), u'analysis': set([u'delta_volume', u'errors', u'max_force', u'delta_volume_percent', u'warnings']), u'output': set([u'is_gap_direct', u'density', u'is_metal', u'energy', u'bandgap', u'vbm', u'energy_per_atom', u'spacegroup', u'cbm', u'structure'])}
set_analysis(d, max_force_threshold=0.5, volume_change_threshold=0.2)

Adapted from matgendb.creator

set the ‘analysis’ key

set_input_data(d_calc, d)

set the ‘input’ key

set_output_data(d_calc, d)

set the ‘output’ key

set_state(d_calc, d)

set the ‘state’ key

atomate.vasp.powerups module

atomate.vasp.submission_filter module

class atomate.vasp.submission_filter.SubmissionFilter(is_valid=True, potcar_exists=True, max_natoms=200, is_ordered=True, not_in_MP=True, MAPI_KEY=None, require_bandstructure=False)

Bases: pymatgen.alchemy.filters.AbstractStructureFilter

NO_POTCARS = [u'Po', u'At', u'Rn', u'Fr', u'Ra', u'Am', u'Cm', u'Bk', u'Cf', u'Es', u'Fm', u'Md', u'No', u'Lr']
__init__(is_valid=True, potcar_exists=True, max_natoms=200, is_ordered=True, not_in_MP=True, MAPI_KEY=None, require_bandstructure=False)
as_dict()
classmethod from_dict(d)
test(structure)

atomate.vasp.vasp_config module

atomate.vasp.vasp_powerups module

Module contents