-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add data structure to save and restart a simulation. #149
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
==========================================
+ Coverage 94.77% 94.90% +0.13%
==========================================
Files 26 26
Lines 1970 2021 +51
==========================================
+ Hits 1867 1918 +51
Misses 103 103
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really good PR. Thank you for putting the effort on this Chris.
I just added one question about wall forces.
This PR adds
Simulation.save_simulation_pickle
andSimulation.from_simulation_pickle
methods that save everything needed to save and restart a simulation (state, forces, reference values, and kwargs).A couple notes:
The
save_simulation_pickle
method writes a binary string to the file that is checked byfrom_simulation_pickle
before opening the pickle withpickle.load
.Using local snapshots, or
state.get_snapshot()
aren't pickleable, so we have to save atemp.gsd.
file, then pickle thegsd.hoomd.Frame
state instead.