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 connection validity #540

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Refactor connection validity #540

merged 1 commit into from
Jan 13, 2025

Conversation

liamhuber
Copy link
Member

The instance check to see if a connection candidate has the correct (conjugate) type now occurs only once in the parent Channel class. Channel._valid_connection is the repurposed to check for validity inside the scope of the classes already lining up, and defaults to simply returning True in the base class. DataChannel overrides it to do the type hint comparison.

Changes inspired by conversation with @XzzX.

The instance check to see if a connection candidate has the correct (conjugate) type now occurs only _once_ in the parent `Channel` class. `Channel._valid_connection` is the repurposed to check for validity inside the scope of the classes already lining up, and defaults to simply returning `True` in the base class. `DataChannel` overrides it to do the type hint comparison.

Changes inspired by [conversation](#533 (comment)) with @XzzX.

Signed-off-by: liamhuber <[email protected]>
Copy link

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

@liamhuber liamhuber mentioned this pull request Jan 10, 2025
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (fc41dfa) 3399 3111 91.53%
Head commit (c77bcbd) 3395 (-4) 3107 (-4) 91.52% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#540) 13 13 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: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@liamhuber liamhuber requested a review from XzzX January 10, 2025 18:06
@XzzX
Copy link
Contributor

XzzX commented Jan 13, 2025

I like it!

@XzzX XzzX merged commit 3e8c92f into mypy Jan 13, 2025
19 of 20 checks passed
@XzzX XzzX deleted the valid_connection_refactor branch January 13, 2025 07:20
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