pyiron / pyiron_workflow

Graph-and-node based workflows
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

:fire: :bug: Don't pull on input nodes #318

Closed liamhuber closed 1 month ago

liamhuber commented 1 month ago

A simple call invokes a pull, including pulling the parent tree -- this blows up when the loop is inside a parent scope instead of alone. Since we know these are just user input nodes with direct value connections to the loop macro's scope, we never need to run the pull, or indeed even a fetch the value.

Before, this caused trouble, now it's fine:

from pyiron_workflow import Workflow

@Workflow.wrap.as_macro_node()
def LoopInside(self, x, y):
    self.to_list = Workflow.create.transformer.inputs_to_list(
        3, y, y, y
    )
    self.loop = Workflow.create.for_node(
        Workflow.create.standard.Add,
        iter_on=("obj", "other",),
        obj=x,
        other=self.to_list
    )
    return self.loop

li = LoopInside([1, 2], 4)
li().loop
github-actions[bot] commented 1 month ago

Binder :point_left: Launch a binder notebook on branch _pyiron/pyiron_workflow/hotfix_forloop

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.00% (target: -1.00%) :white_check_mark: 100.00%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (083e9fbcf47cad683201d16eb5f220b5606f95e1) | 3925 | 3507 | 89.35% | | | Head commit (16262420e2eb64f84993146b1d8ea62aa394979c) | 3925 (+0) | 3507 (+0) | 89.35% (**+0.00%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#318) | 1 | 1 | **100.00%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9008828459

Details


Totals Coverage Status
Change from base Build 8977377408: 0.0%
Covered Lines: 3507
Relevant Lines: 3925

💛 - Coveralls