Skip to content

Conversation

@liamhuber
Copy link
Member

Closes #498. This doesn't make the graph truly deterministic yet, but it does resolve the explicit non-determinacy mentioned there.

The goes part of the way to resolving #502, but there we need what is currently the sole input "connection" and the current concept of a "value_receiver" (well, "value_source" from the perspective of the input channel) to be put on more equal footing -- i.e. each data node can have at most one upstream "source". So this is related PR, but I leave that issue open.

Even though making multiple connections is now strictly illegal, when we go via the route of assignment to input panels there is syntactic sugar to do the necessary disconnection for you. IMO this should feel very pythonic, as when we assign something new to the attribute of course the old assignment is thrown away. E.g.

import pyiron_workflow as pwf

wf = pwf.Workflow("single_input")
wf.n1a = pwf.std.UserInput(0)
wf.n1b = pwf.std.UserInput(100)
wf.n2 = pwf.std.UserInput()

wf.n2.inputs.user_input = wf.n1a
wf.n2.inputs.user_input = wf.n1b
wf()
>>> {'n1a__user_input': 0, 'n2__user_input': 100}

Where we see n2 is correctly leveraging its one and only more-recent source, and we can see that the old source got disconnected because the workflow can tell it's a dangling output.

This means the "manually constructed while-loop" demo had to be thrown out of the integration tests, because the whole concept of relying on the "input connection stack" no longer exists. This should be fine, as while-loop behaviour has its own class now (#650)

So that we can automatically disconnect existing data input connections when assigning a new connections

Signed-off-by: liamhuber <[email protected]>
Removing the "input is prioritized" section and replacing it with a demo of how each data input can only have one connections

Signed-off-by: liamhuber <[email protected]>
Signed-off-by: liamhuber <[email protected]>
Allowing a single input connection expressly destroys this concept. We already replaced the functionality with a `While` node.

Signed-off-by: liamhuber <[email protected]>
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_workflow/single_input

@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.85%. Comparing base (90c9fa1) to head (f4583bf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
- Coverage   92.05%   91.85%   -0.20%     
==========================================
  Files          34       34              
  Lines        3576     3587      +11     
==========================================
+ Hits         3292     3295       +3     
- Misses        284      292       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liamhuber liamhuber merged commit 87b01eb into main Jun 18, 2025
21 checks passed
@liamhuber liamhuber deleted the single_input branch June 18, 2025 18:18
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.

deterministic graph execution

2 participants