aiidateam / aiida-workgraph

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, and remote execution capabilities.
https://aiida-workgraph.readthedocs.io/en/latest/
MIT License
10 stars 5 forks source link

Be careful on the inputs of the `graph_builder` task. #313

Open superstar54 opened 2 months ago

superstar54 commented 2 months ago

In principle, a graph_builder task can accept non orm.Data as input. For example, when users use PythonJob, we allow them to pass raw Python data as input, so that they do not need to know orm.Data. However, when the graph_builder task use the output of another task as its input, the input value could be a orm.Data, therefore, the graph_builder task handles both cases.

@task.graph_builder()
def relax_workgraph(
    atoms: Atoms = None,
    command: str = "pw.x",
):

In the above example, the input atoms could be an ase.Atoms or aiida_workgraph.orm.atoms.AtomsData.