generated from pyiron/pyiron_module_template
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
From #38
We won't abandon delayed execution, but let's add a flag to allow newly instantiated nodes to run (if ready
), ala
from pyiron_workflow import Workflow
@Workflow.wrap_as.function_node(run_on_instantiation=True)
def update_immediately(x=0, y=1):
return x+1, y+2
default_aggressive = update_immediately(y=3)
print(default_aggressive.outputs.to_value_dict())
>>> {"x+1": 1, "y+2": 5}
# Or
@Workflow.wrap_as.function_node()
def normal(x=0, y=1):
return x-1, y-2
explicit_instruction_to_be_agressive = normal(x=10, run_on_instantiation=True)
print(explicit_instruction_to_be_agressive.outputs.to_value_dict())
>>> {"x-1": 9, "y-2": -1}
Metadata
Metadata
Assignees
Labels
No labels