Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support creating tasks from builders #356

Open
GeigerJ2 opened this issue Nov 21, 2024 · 1 comment
Open

Support creating tasks from builders #356

GeigerJ2 opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@GeigerJ2
Copy link
Contributor

GeigerJ2 commented Nov 21, 2024

Currently, only nested dictionaries can be used to populate the parameters of a task. Support setting also from a builder (similar to submit in AiiDA, where you can provide either the class and the input parameters, or the builder).

As noted by @rikigigi, who had to first convert the builder data to a nested dictionary.

@superstar54
Copy link
Member

superstar54 commented Dec 4, 2024

Hi @GeigerJ2 , thanks for taking care of this issue. Setting task inputs from the builder is now supported in the set_from_builder method, but creating tasks from the builder has not been implemented yet.

I think we want to support syntax similar to the following code:

from aiida.calculations.arithmetic.add import ArithmeticAddCalculation
from aiida_workgraph import WorkGraph
from aiida import orm

builder = ArithmeticAddCalculation.get_builder()
builder.code = code
builder.x = orm.Int(2)
builder.y = orm.Int(3)

wg = WorkGraph("test_set_inputs_from_builder")
# use builder to create task
add1 = wg.add_task(builder, name="add1")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants