add_metadata_to_flow¶
- atomate2.vasp.powerups.add_metadata_to_flow(flow, additional_fields, class_filter=BaseVaspMaker)[source]¶
Add custom metadata fields to VASP task documents in a flow.
Adds user-defined metadata to the task documents generated by VASP jobs, which is useful for organizing and querying results in databases.
- Parameters:
flow (Flow) – The flow to which metadata will be added.
additional_fields (dict) – Dictionary of metadata fields to add to task documents. Keys are field names, values are the metadata values.
class_filter (Maker, optional) – The maker class to which metadata will be added. Only jobs created by this maker class or its subclasses will have metadata added. Default is BaseVaspMaker.
- Returns:
A copy of the flow with metadata added to matching task documents.
- Return type:
Flow
Examples
>>> metadata = {"project": "battery_materials", "batch": "exp_001"} >>> flow = add_metadata_to_flow(flow, metadata)