Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the two ways of adding into a single method #682

Merged
merged 2 commits into from
May 18, 2023

Conversation

liamhuber
Copy link
Member

Which is itself refactored so the checks are a bit more readable. There was one behaviour change here, and that is that we now allow iterating on labels even during node-addition-by-attribute-assignment (of course, still only when strict_naming is deactivated). I.e.

from pyiron_contrib.workflow.workflow import Workflow

@Workflow.wrap_as.node("y")
def fnc(x=0): return x + 1

wf = Workflow("my_workflow")
wf.deactivate_strict_naming()

wf.baz = fnc(label="base")
wf.baz = fnc(label="zeroth")
wf.baz = fnc(label="first")

print(wf.nodes.keys())
>>> dict_keys(['baz', 'baz0', 'baz1'])

Test is updated accordingly.

Which is itself refactored so the checks are a bit more readable. There was _one_ behaviour change here, and that is that we now allow iterating on labels even during node-addition-by-attribute-assignment (of course, still only when strict_naming is deactivated).
@coveralls
Copy link

coveralls commented May 16, 2023

Pull Request Test Coverage Report for Build 5019152589

  • 31 of 34 (91.18%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 13.317%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_contrib/workflow/workflow.py 31 34 91.18%
Totals Coverage Status
Change from base Build 4998433075: 0.05%
Covered Lines: 1655
Relevant Lines: 12428

💛 - Coveralls

@liamhuber liamhuber added format_black Invoke a black formatting commit and removed format_black Invoke a black formatting commit labels May 18, 2023
@liamhuber liamhuber merged commit 418495d into main May 18, 2023
@delete-merged-branch delete-merged-branch bot deleted the cleaner_node_association branch May 18, 2023 23:39
@liamhuber liamhuber restored the cleaner_node_association branch May 18, 2023 23:44
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