pyiron / pyiron_workflow

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

[minor] Executor compliance #304

Closed liamhuber closed 1 month ago

liamhuber commented 1 month ago

on_run is no longer a property returning a staticmethod that will be shipped off, but we directly ship off self.on_run so self goes with it to remote processes. Similarly, run_args gets extended to be tuple[tuple, dict] so positional arguments can be sent too.

Stacked on top of pickleability, this means we can now use standard concurrent.futures.ProcessPoolExecutor -- as long as the nodes are all defined somewhere importable, i.e. not in __main__. Since working in notebooks is pretty common, the more flexible pympipool.Executor is left as the default Workflow.create.Executor.

This simplifies some stuff under the hood too, e.g. Function and Composite now just directly do their thing in on_run instead of needing the misdirection of returning their own static methods.

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

github-actions[bot] commented 1 month ago

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

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.03% (target: -1.00%) :white_check_mark: 86.00%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (23c787fb4c19cb81cbe57843dc86fffcdea335e7) | 3728 | 3304 | 88.63% | | | Head commit (d1971f3bea50ebfe49db03fdb391e6ba2a7e51f0) | 3713 (-15) | 3292 (-12) | 88.66% (**+0.03%**) | **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 (#304) | 50 | 43 | **86.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

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

liamhuber commented 1 month ago

Ah, rebasing onto the other branch borked the commit history again. It's not functionally problematic, just ugly.

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 8976709322

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
function.py 1 98.08%
transform.py 1 96.2%
semantics.py 3 96.79%
node.py 6 94.36%
run.py 9 89.13%
create.py 10 91.95%
composite.py 11 92.46%
<!-- Total: 41 -->
Totals Coverage Status
Change from base Build 8976677163: 0.03%
Covered Lines: 3292
Relevant Lines: 3713

💛 - Coveralls