Skip to content

Conversation

@liamhuber
Copy link
Contributor

@liamhuber liamhuber commented May 23, 2025

@jan-janssen, I left your function in-place; this PR purely adds a new function for converting function DAG JSONs in the python-workflow-definition format into pyiron_workflow.Workflow objects.

from python_workflow_definition.pyiron_workflow import build_function_dag_workflow, write_workflow_json

write_workflow_json(
  build_function_dag_workflow("workflow.json").graph_as_dict, file_name="cycled.json")
)

The underlying workflow runs and draws the same, and this cycle produces a JSON file identical to pyiron_workflow_arithmetic.json produced by the arithmetic example notebook. Hopefully that means it suits the rest of your needs.

I wasn't confident that the import routine captures more deeply nested function definitions, so I copy-pasted a routine import_from_string from bagofholding. I think it might later be a nice addition to pyiron_snippets, but for something so small a copy-paste here is fine.

Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
@jan-janssen jan-janssen merged commit 038bc85 into pythonworkflow:pyiron_workflow May 24, 2025
6 of 7 checks passed
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.

2 participants