pyiron / pyiron_workflow

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

[patch] Refactor interfaces #245

Closed liamhuber closed 3 months ago

liamhuber commented 3 months ago

This introduces a new module has_interface_mixins to hold all the classes that are just there to guarantee the another class has some particular attribute or method. Such mixins are useful when we decompose responsibility into different components, but component A needs to know about some particular aspect of component B -- e.g., re:#243, HasIO will need to know about the run method, but it won't care at all what it does, so Runnable and HasIO will both inherit from HasRun, but for HasIO this is just to guarantee that the IO mixin gets combined with some other component that defines run.

I intentionally ignore the HasToDict mixin here, because (a) it does somewhat more than simply guarantee the interface, and (b) it's on death row anyhow, as it's just there for prettier representations and I think we're going to be able to accomplish that more elegantly in other ways soon.

This is all under-the-hood, so no changes to the user interface.

github-actions[bot] commented 3 months ago

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

codacy-production[bot] commented 3 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.02% (target: -1.00%) :white_check_mark: 100.00%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (563f438b0c7de7c8940e90d1d49a814eca3a636d) | 3231 | 2810 | 86.97% | | | Head commit (f5bca5e466e26703b60133e532c7cfcf59737980) | 3236 (+5) | 2815 (+5) | 86.99% (**+0.02%**) | **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 (#245) | 11 | 11 | **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

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8403853272

Details


Files with Coverage Reduction New Missed Lines %
semantics.py 6 95.76%
<!-- Total: 6 -->
Totals Coverage Status
Change from base Build 8403845120: -0.07%
Covered Lines: 6005
Relevant Lines: 6549

💛 - Coveralls
liamhuber commented 3 months ago

Well shoot, squashing and merging the semantic branch means all the squashed commits here still show up! I'm sure there is some sort of rebasing scheme that allows squashing to play well with stacking, but it's not something I want to work out on a Saturday, so for the rest of the stack I'm not going to squash.