ThermoBuilder

class emmet.builders.materials.thermo.ThermoBuilder(thermo, corrected_entries, phase_diagram=None, query=None, num_phase_diagram_eles=None, chunk_size=1000, **kwargs)

Bases: Builder

Parameters:
  • thermo (Store)

  • corrected_entries (Store)

  • phase_diagram (Store | None)

  • query (dict | None)

  • num_phase_diagram_eles (int | None)

  • chunk_size (int)

ensure_indexes()

Ensures indicies on the tasks and materials collections

prechunk(number_splits)

Part of a domain-decomposition paradigm to allow the builder to operate on multiple nodes by dividing up the IO as well as the compute This function should return an iterator of dictionaries that can be distributed to multiple instances of the builder to get/process/update on.

Return type:

Iterator[dict]

Parameters:

number_splits (int)

Arguments:

number_splits: The number of groups to split the documents to work on

get_items()

Gets whole chemical systems of entries to process

Return type:

Iterator[list[dict]]

process_item(item)

Process an item. There should be no database operations in this method. Default behavior is to return the item.

Arguments:

item:

Returns:

item: an item to update

update_targets(items)

Inserts the thermo and phase diagram docs into the thermo collection Args:

items ([[tuple(list[dict],list[dict])]]): a list of a list of thermo and phase diagram dict pairs to update