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

Implement DOT based workflow skeleton creator #6

Merged
merged 11 commits into from
Oct 1, 2024
Merged

Conversation

samwaseda
Copy link
Collaborator

Based on this discussion (thanks @liamhuber) I implemented the functionality to create empty functions for pyiron workflow. I didn't really add comments in the notebook, but I guess it's relatively straightforward if you look at dot.ipynb and read the issue page.

In order to address the concern raised by @liamhuber, I also added the possibility to include types in labels with the same notation as in function, such as vehicle: str.

@samwaseda
Copy link
Collaborator Author

@liamhuber I just failed to talk to you but maybe you have a good idea: There's one part I don't particularly like about this workflow right now, which is the fact that the user is required to copy and paste the content of EmptyGraph.get_str() in the notebook to make a pyiron workflow. Do you have maybe an idea?

@liamhuber
Copy link
Collaborator

@samwaseda, I guess instead of EmptyGraph.get_str it should be possible to define EmptyGraph.to_workflow(wf_label: str) -> Workflow that returns the instance right away, i.e. you would be able to write

...
wf = eg.to_workflow("travel_time")
wf.draw()
wf(
    vehicle__vehicle="Car",
    ...
)  # but I guess this would crash unless we're super clever about spoofing the nodes...

However, I'm not sure that's actually what we want; maybe we really want them to have that string to modify. By the same token you could exec the string, but it's also missing the input definitions and again maybe the string itself is what's wanted.

@samwaseda
Copy link
Collaborator Author

Yep now as you pointed out it appears so obvious that we need a function to return a workflow. Let me see what I can do

@mbruns91 mbruns91 merged commit d04a534 into main Oct 1, 2024
2 checks passed
@mbruns91 mbruns91 deleted the mock_workflow branch October 1, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants