generated from pyiron/pyiron_module_template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Store with h5io #181
Merged
Merged
Store with h5io #181
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The promises are slightly different, but the saving of aggregate workflows with all children from packages should work the same for both back ends, so test it
Ultimately, I want to lean directly on tinybase for this, but in the intermediate where we have both tinybase _and_ pure h5io back ends, let's pull things out to keep the base node class tidier.
Call it the backend instead of the mode throughout, prepending with "storage_" if the context is not 100% clear (e.g. in node inits)
Saving and loading is done all at once by the parent; new child instances do not look for their own saved data.
Required moving the macro nodes over to a node package
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
liamhuber
added
format_black
trigger the Black formatting bot
and removed
format_black
trigger the Black formatting bot
labels
Jan 29, 2024
Base automatically changed from
parent_decorated_nodes_to_their_module
to
simple_storage
January 30, 2024 18:14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
by default instead of
tinybase.storage.h5io
. Depends on all three of these PRs over onh5io
, so like the root PR here (#160), there's no way for the tests to run on the CI.After a bunch of upstream PRs here getting the
__get/setstate__
in better shape, saving is just:And loading is just:
Which is nice and clean, but can fail if the data channels hold values that don't play nicely with
h5io
.@pmrv and @jan-janssen, at some point I think I'll need a meeting with both of you together to help me work through the strengths and weaknesses of the different solutions available here. I'm slugging along steadily, but I feel a bit out of my depth.
Overall what I like about the
h5io
solution is that it is leveraging__get/setstate__
, so it's largely enough for me to get(cloud)pickle
happy with those and then I can just pass the whole objects towrite_hdf5
or get them back withread_hdf5
(and use the returned object to set state). So it's extremely concise.On the other hand
tinybase.storage
feels much more transparent on what it's storing where, and it is both more clear when it falls back to a pickle solution and much more powerful when it does it -- e.g.h5io.write_hdf5
borks on instances ASE'sEMT
because of some random and innocuous seeming method on the parentCalculator
class; so I can't even store the atomistics workflows with this tool. Also, as much as it's more write, the facttinybase.storage
forces me to use something other than the state methods means that I have more control over the storage path, so nodes can be stored on their semantic path, e.g.my_wf/my_macro/some_node
instead ofmy_wf/nodes/my_macro/nodes/some_node
.Finally, in the medium term, it will become important to resolve the versions of the stored object more vigorously, and ultimately have a framework that supports upgrading stored data to new (compatible) versions. I'm sure we can get this done, but the path forward is not yet super clear for me on this front.
TODO:
And of course updates once the dependent packages actually existThis is a wontfix unless the upstream out-of-repo PRs get finished and merged before I want to stack something on top of this