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

Introduce HasChannel #655

Merged
merged 7 commits into from
May 1, 2023
Merged

Introduce HasChannel #655

merged 7 commits into from
May 1, 2023

Conversation

liamhuber
Copy link
Member

A new mix-in class that demands that children have a channel -> Channel property.

The Channel class is re-parented onto this and returns self for the property. This forms a tautology, but doesn't really hurt anything.

Now, however, when the IO classes are transforming assignments into connections, all they need to do is check if the assignee is a HasChannel instance and use its channel. In our case, SingleValueNode(FastNode) -> SingleValueNode(FastNode, HasChannel), where channel is just the single output channel. This simplifies the stuff in IO and is re-usable in case we have other classes we want to be able to (attempt!) to connect to (the connection validity will still get tested during the connection).

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4855215939

  • 23 of 25 (92.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 12.867%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_contrib/workflow/has_channel.py 8 10 80.0%
Totals Coverage Status
Change from base Build 4855037198: 0.1%
Covered Lines: 1580
Relevant Lines: 12279

💛 - Coveralls

@liamhuber liamhuber merged commit e02f048 into main May 1, 2023
@delete-merged-branch delete-merged-branch bot deleted the refactor_connections branch May 1, 2023 22:04
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