MaterialsBuilder

class emmet.builders.vasp.materials.MaterialsBuilder(tasks, materials, task_validation=None, query=None, settings=None, **kwargs)

Bases: Builder

The Materials Builder matches VASP task documents by structure similarity into materials document. The purpose of this builder is group calculations and determine the best structure. All other properties are derived from other builders.

The process is as follows:

1.) Find all documents with the same formula 2.) Select only task documents for the task_types we can select properties from 3.) Aggregate task documents based on structure similarity 4.) Create a MaterialDoc from the group of task documents 5.) Validate material document

Parameters:
  • tasks (Store)

  • materials (Store)

  • task_validation (Store | None)

  • query (dict | None)

  • settings (EmmetBuildSettings | None)

ensure_indexes()

Ensures indices on the tasks and materials collections

prechunk(number_splits)

Prechunk the materials builder for distributed computation

Return type:

Iterable[dict]

Parameters:

number_splits (int)

get_items()

Gets all items to process into materials documents. This does no datetime checking; relying on whether task_ids are included in the Materials Collection

Return type:

Iterator[list[dict]]

Returns:

generator or list relevant tasks and materials to process into materials documents

process_item(items)

Process the tasks into a list of materials

Return type:

list[dict]

Parameters:

items (list[dict])

Args:

tasks [dict]: a list of task docs

Returns:
([dict],list): a list of new materials docs and a list of task_ids that

were processed

update_targets(items)

Inserts the new task_types into the task_types collection

Args:
items ([([dict],[int])]): A list of tuples of materials to update and the

corresponding processed task_ids

Parameters:

items (list[list[dict]])

filter_and_group_tasks(tasks, task_transformations)

Groups tasks by structure matching

Return type:

Iterator[list[TaskDoc]]

Parameters:
  • tasks (list[TaskDoc])

  • task_transformations (list[dict | None])