pyiron / pyiron_workflow

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

[patch] uniformly expose `filename` in `Node` storage interface. #473

Closed liamhuber closed 1 month ago

liamhuber commented 1 month ago

It's already there in the underlying storage interface, and in Node.save, so here we just extend the exposure to Node.load, .has_saved_content, and .delete_storage.

I.e.


from pyiron_workflow import Workflow

n = Workflow.create.standard.UserInput(42)
n.save(filename="foo")
n.has_saved_content()
>>> False
n.has_saved_content(filename="foo")
>>> True
n.delete_storage(filename="foo")
n.has_saved_content(filename="foo")
>>> False

This will be useful for things automatic saving on failure, etc, where we don't want to overwrite the user's save file and don't necessarily want the node loading at re-instantiation. Just more flexibility overall.

github-actions[bot] commented 1 month ago

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

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.06% (target: -1.00%) :white_check_mark: 100.00%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (a267c795fc2bb5d43e27063bb917001966b6953b) | 3304 | 3023 | 91.50% | | | Head commit (221aa5ffd209e8cac2e6ec87a5704a54bc843238) | 3304 (+0) | 3025 (+2) | 91.56% (**+0.06%**) | **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 (#473) | 2 | 2 | **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

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

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 11018377723

Details


Files with Coverage Reduction New Missed Lines %
node.py 8 90.3%
<!-- Total: 8 -->
Totals Coverage Status
Change from base Build 11017957536: 0.06%
Covered Lines: 3025
Relevant Lines: 3304

💛 - Coveralls