-
Notifications
You must be signed in to change notification settings - Fork 5
[New WfMS] Implement Python Workflow Definition in pyiron_workflow #111
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
base: main
Are you sure you want to change the base?
Conversation
Hi @jan-janssen, I'm just migrating your e-mail comment here
I forked the repo. I didn't install all the dependencies for the other managers, but for the arithmetic example I can see that
Later this morning I'll tack a crack at debugging |
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
@liamhuber Thanks a lot, based on your pull request I was able to get the arithmetic example to work as well as the nfdi4ing example. The missing part is the quantum espresso example, here we use the following def get_dict(**kwargs) -> dict:
return {k: v for k, v in kwargs.items()} This is not compatible with the type checking from |
Super, glad it is working so well! Unfortunately the function you show for the quantum espresso example will never work. In pyiron_workflow, we insist that each node's IO is known already at the class level (ie at recipe time). You might be able to hack something together with the inputs-to-dict meta-node (which creates a subclass of a generic input channels to dictionary node with fixed input channels). Better, IMO, would be to write a more explicit function for the workflow. |
The challenge is that the @liamhuber Can you explain a bit more more how the hacky solution would work? |
The problem isn't the dict, it's the
Not really, I just wonder if there's some way to abuse In general though, def get_dict(**kwargs) -> dict:
return {k: v for k, v in kwargs.items()} seems like a bad node to me. It doesn't have clear handles for its IO at the recipe level -- you only actually know what the node's interface looks like at runtime. I haven't dug into how you're getting it to work for the other examples, so maybe you have some graceful way around this. |
@liamhuber I was able to implement a workaround for importing the Quantum ESPRESSO workflow from the Python Workflow Definition to pyiron_workflow. For the other way of exporting from pyiron_workflow to the Python Workflow Definition I am still struggling with the Furthermore, the |
@jan-janssen, following the |
@liamhuber Thanks a lot, that definitely clarified the issue with the execution before calling Still there is one confusing issue remaining when I use the following code, everything works fine: volume_dict = {"s_" + str(i): j["volume"] for i, j in enumerate(job_strain_lst)}
wf.volume_dict = inputs_to_dict(
input_specification=list(volume_dict.keys()),
**volume_dict
)
energy_dict = {"s_" + str(i): j["energy"] for i, j in enumerate(job_strain_lst)}
wf.energy_dict = inputs_to_dict(
input_specification=list(energy_dict.keys()),
**energy_dict,
)
wf.volume_lst = get_values_from_dict(
input_dict=wf.volume_dict
)
wf.energy_lst = get_values_from_dict(
input_dict=wf.energy_dict
) But when I use the following modied code, it does not: volume_dict = {"s_" + str(i): j["volume"] for i, j in enumerate(job_strain_lst)}
wf.volume_lst = get_values_from_dict(
input_dict=inputs_to_dict(
input_specification=list(volume_dict.keys()),
**volume_dict
)
)
energy_dict = {"s_" + str(i): j["energy"] for i, j in enumerate(job_strain_lst)}
wf.energy_lst = get_values_from_dict(
input_dict=inputs_to_dict(
input_specification=list(energy_dict.keys()),
**energy_dict,
)
) I get the following error message:
|
@jan-janssen, super! Yes, I'm open to suggestions for how to make the error message friendlier, but it contains all the necessary information we need. Namely, we're trying to connect It works in the first example because you're explicitly declaring the volume_dict = {"s_" + str(i): j["volume"] for i, j in enumerate(job_strain_lst)}
wf.volume_lst = get_values_from_dict(
input_dict=inputs_to_dict(
input_specification=list(volume_dict.keys()),
parent=wf, # Parent the implicit node before using as input
**volume_dict
)
)
energy_dict = {"s_" + str(i): j["energy"] for i, j in enumerate(job_strain_lst)}
wf.energy_lst = get_values_from_dict(
input_dict=inputs_to_dict(
input_specification=list(energy_dict.keys()),
parent=wf, # Parent the implicit node before using as input
**energy_dict,
)
) |
@liamhuber Thanks again, I was able to fix the last remaining issues. Now the interface between pyiron_workflow and the Python Workflow Definition supports all three examples in both directions import and export. |
Status of the Implementation for pyiron_workflow
