pyiron / pyiron_workflow

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

[minor] Move stuff #362

Closed liamhuber closed 5 months ago

liamhuber commented 5 months ago

This is a refactor, but since there was not a concrete API and things are in different places, it's a minor rather than patch bump.

I took everything downstream of Node (except Workflow) and moved it into the submodule nodes, and everything upstream of Node (or mixed into a subclass) and Channel and moved it into the submodule mixin. IMO this makes the entire project structure easier to understand.

While users are still intended to use Workflow as a single-point-of entry -- and supported in this by the creator/wrapper menus -- I also found that people developing nodes seem to like to import stuff like as_function_node directly and use it. This is now explicitly supported by a "node developer API" section of the __init__ file which has all the standard factories, decorators, creators, and parent classes that should be necessary for day-to-day creation of new node packages.

review-notebook-app[bot] commented 5 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

github-actions[bot] commented 5 months ago

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

codacy-production[bot] commented 5 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.05% (target: -1.00%) :white_check_mark: 95.24%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (50656b2057a3f090424575cc7cb8b5a150d4bc09) | 3418 | 3163 | 92.54% | | | Head commit (30e2ced0b90cffbcc05780fe6402c4c9ea3a5b81) | 3428 (+10) | 3174 (+11) | 92.59% (**+0.05%**) | **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 (#362) | 126 | 120 | **95.24%** | **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


:rocket: Don’t miss a bit, follow what’s new on Codacy.

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

liamhuber commented 5 months ago

I considered and (for now) rejected the idea of moving things the nodes/channels use but don't inherit from into their own submodule (e.g. draw, parse_output, topology, etc, into tools or similar). I found unlike the mixins/nodes which could be clearly identified by their up/downstream position in the Node inheritance hierarchy, for these objects there was no such clear-cut way to distinguish what should be moved into the submodule and what should be left at the main level.

It is still clear that something like topology is more niche than something like io, so I see room to further pare down the main level of the module in the future -- I just don't have a clear vision for how to do it right now.

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 9470936620

Details


Files with Coverage Reduction New Missed Lines %
io.py 12 94.35%
workflow.py 16 80.87%
<!-- Total: 28 -->
Totals Coverage Status
Change from base Build 9457867783: 0.05%
Covered Lines: 3174
Relevant Lines: 3428

💛 - Coveralls
coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 9470958205

Details


Files with Coverage Reduction New Missed Lines %
io.py 14 94.35%
workflow.py 16 80.87%
<!-- Total: 30 -->
Totals Coverage Status
Change from base Build 9457867783: 0.05%
Covered Lines: 3174
Relevant Lines: 3428

💛 - Coveralls