matmethods.vasp.builders package

Submodules

matmethods.vasp.builders.base module

class matmethods.vasp.builders.base.AbstractBuilder

Bases: object

Abstract builder class. Defines the contract and must be subclassed by all builders.

classmethod from_file(filename)

Set the builder from a db file

reset()

Unset the building.

run()

Run the builder.

matmethods.vasp.builders.boltztrap_materials module

class matmethods.vasp.builders.boltztrap_materials.BoltztrapMaterialsBuilder(materials_write, boltztrap_read)

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(materials_write, boltztrap_read)

Update materials collection based on boltztrap collection.

Args:
materials_write (pymongo.collection): mongodb collection for materials (write access needed) boltztrap_read (pymongo.collection): mongodb collection for boltztrap (suggest read-only for safety)
classmethod from_file(db_file, m=u'materials', b=u'boltztrap', **kwargs)

Get a BoltztrapMaterialsBuilder using only a db file.

Args:
db_file (str): path to db file m (str): name of “materials” collection b (str): name of “boltztrap” collection **kwargs: other params to put into BoltztrapMaterialsBuilder
reset()
run()

matmethods.vasp.builders.example_build module

matmethods.vasp.builders.file_materials module

class matmethods.vasp.builders.file_materials.FileMaterialsBuilder(materials_write, data_file, delimiter=u', ', header_lines=0)

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(materials_write, data_file, delimiter=u', ', header_lines=0)

Updates the database using a data file. Format of file must be: <material_id or formula>, <property>, <value> for which <property> is the materials key to update.

Comment lines should start with ‘#’.

Args:
materials_write: mongodb collection for materials (write access needed) data_file (str): path to data file **kwargs: **kwargs for csv reader
classmethod from_file(db_file, data_file=None, m=u'materials', **kwargs)

Get a FileMaterialsBuilder using only a db file.

Args:
db_file (str): path to db file data_file (str): path to data file m (str): name of “materials” collection **kwargs: other parameters to feed into the builder, e.g. mapi_key
reset()
run()

matmethods.vasp.builders.fix_tasks module

class matmethods.vasp.builders.fix_tasks.FixTasksBuilder(tasks_write)

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(tasks_write)

Fix historical problems in the tasks database

Args:
tasks_write (pymongo.collection): mongodb collection for tasks (write access needed)
classmethod from_file(db_file, t=u'tasks', **kwargs)

Get a FixTasksBuilder using only a db file.

Args:
db_file (str): path to db file t (str): name of “tasks” collection **kwargs: other params to put into FixTasksBuilder
reset()
run()

matmethods.vasp.builders.materials_ehull module

class matmethods.vasp.builders.materials_ehull.MaterialsEhullBuilder(materials_write, mapi_key=None, update_all=False)

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(materials_write, mapi_key=None, update_all=False)

Starting with an existing materials collection, adds stability information and The Materials Project ID. Args:

materials_write: mongodb collection for materials (write access needed) mapi_key: (str) Materials API key (if MAPI_KEY env. var. not set) update_all: (bool) - if true, updates all docs. If false, only updates

docs w/o a stability key
classmethod from_file(db_file, m=u'materials', **kwargs)

Get a MaterialsEhullBuilder using only a db file Args:

db_file: (str) path to db file m: (str) name of “materials” collection **kwargs: other parameters to feed into the builder, e.g. mapi_key
reset()
run()

matmethods.vasp.builders.tags_collector module

class matmethods.vasp.builders.tags_collector.TagsBuilder(materials_write, tasks_read, update_all=False)

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(materials_write, tasks_read, update_all=False)

Starting with an existing materials collection, adds tags from all tasks (if any) in the tasks collection.

Args:
materials_write (pymongo.collection): materials collection with write access. update_all (bool): if true, updates all docs. If false, only updates docs w/o a stability key. tasks_read (pymongo.collection): read-only(for safety) tasks collection.
classmethod from_file(db_file, m=u'materials', t=u'tasks', **kwargs)

Get a TagsCollector using only a db file.

Args:
db_file (str): path to db file m (str): name of “materials” collection **kwargs: other parameters to feed into the builder, e.g. update_all
reset()
run()

matmethods.vasp.builders.tasks_materials module

class matmethods.vasp.builders.tasks_materials.TasksMaterialsBuilder(materials_write, counter_write, tasks_read, tasks_prefix=u't', materials_prefix=u'm')

Bases: matmethods.vasp.builders.base.AbstractBuilder

__init__(materials_write, counter_write, tasks_read, tasks_prefix=u't', materials_prefix=u'm')

Create a materials collection from a tasks collection.

Args:
materials_write (pymongo.collection): mongodb collection for materials (write access needed) counter_write (pymongo.collection): mongodb collection for counter (write access needed) tasks_read (pymongo.collection): mongodb collection for tasks (suggest read-only for safety)
classmethod from_file(db_file, m=u'materials', c=u'counter', t=u'tasks', **kwargs)

Get a TaskMaterialsBuilder using only a db file.

Args:
db_file (str): path to db file m (str): name of “materials” collection c (str): name of “counter” collection t (str): name of “tasks” collection **kwargs: other params to put into TasksMaterialsBuilder
mid_str(material_id)
reset()
run()
tid_int(task_id)
tid_str(task_id)

Module contents