Closed liamhuber closed 6 months ago
Coverage variation | Diff coverage |
---|---|
:white_check_mark: +0.12% (target: -1.00%) | :white_check_mark: 93.10% |
Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_workflow/composite.py | 1 | 99.57% | ||
node.py | 6 | 94.18% | ||
composite.py | 13 | 93.14% | ||
<!-- | Total: | 20 | --> |
Totals | |
---|---|
Change from base Build 8652695857: | 0.2% |
Covered Lines: | 6569 |
Relevant Lines: | 7161 |
This introduces post-facto provenance to executed composites (both macros and workflows) in the form of child label lists. @JNmpi, this closes a feature gap we had with other workflow managers.
There are separate lists for the execution order and the completion order, since these can differ under certain conditions where an executor is used for parallelism and the time required for different children differs significantly. this feature and the basic syntax are shown below:
Under the hood, nodes without parents behave just like they always did: when they finish, they emit their
ran
signal, which triggers downstream nodes. However, nodes with parents now allow their parent to manage execution by interacting with the parent'sregister_child_starting
,register_child_finished
, andregister_child_emitting_ran
interfaces, which control the provenance lists as well as lists of nodes currently running and of signal pairs waiting to be fired. Running a composite then has awhile
loop over both running nodes and signal pairs having lengths >0.This has a nice side-effect of shortening the stack when an error is encountered during the run, since children always just go up to their parent and then stop, instead of having to trace back through every node. This resolves the recursion limit bug with while-loops and closes #247. (The provenance for while-nodes is sensible, but not super informative -- just their children again and again and again.)
The only thing I really don't like is
Node.pull
in the presence of aWorkflow
parent required some nasty hacking to getWorkflow
to stop automating the flow and ruining the careful orchestration of execution signals thatpull
uses to run only the relevant portion of the upstream graph. I don't see a more clever solution right now, and so I'm very open to suggestions for improvement, but am willing to tolerate a few lines of ugliness inNode.pull
to get the entire feature off the ground.Non-goals:
Composite.draw
to (depending on a flag) pass in one of the provenance lists and use it to draw some extra arrows.