ElasticityBuilder

class emmet.builders.materials.elasticity.ElasticityBuilder(tasks, materials, elasticity, query=None, fitting_method='finite_difference', **kwargs)

Bases: Builder

Parameters:
  • tasks (Store)

  • materials (Store)

  • elasticity (Store)

  • query (dict | None)

  • fitting_method (str)

get_items()

Gets all items to process into elasticity docs.

Return type:

Generator[tuple[str, dict[str, str], list[dict]], None, None]

Returns:

material_id: material id for the tasks calc_types: calculation types of the tasks tasks: task docs belong to the same material

process_item(item)

Process all tasks belong to the same material into an elasticity doc.

Return type:

dict | None

Parameters:

item (tuple[Annotated[MPID | AlphaID, BeforeValidator(func=~emmet.core.types.typing._fault_tolerant_id_serde, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~emmet.core.types.typing.<lambda>, return_type=PydanticUndefined, when_used=always)], dict[str, str], list[dict]])

Args:
item:

material_id: material id for the tasks calc_types: {task_id: task_type} calculation types of the tasks tasks: task docs belong to the same material

Returns:

Elasticity doc obtained from the list of tasks. None if failed to obtain the elasticity doc from the tasks.

update_targets(items)

Insert the new elasticity docs into the elasticity collection.

Args:

items: elasticity docs

Parameters:

items (list[dict])