Open wmjolly opened 3 years ago
"NFDRS has a 'State' variable that allows you to save the current model states. This allows you to calculate some indices, stop the calculations and then restart from where you left off."
This works in Python:
from nfdrs import NFDR2016Calc
nf= NFDR2016Calc()
nf.SaveState("state.bin");
nf.ReadState("state.bin");
That is perfect! Thanks for this.
On Tue, Mar 9, 2021 at 1:16 AM alexander-petkov notifications@github.com wrote:
"NFDRS has a 'State' variable that allows you to save the current model states. This allows you to calculate some indices, stop the calculations and then restart from where you left off."
This works in Python:
from nfdrs import NFDR2016Calc nf= NFDR2016Calc()nf.SaveState("state.bin");nf.ReadState("state.bin");
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexander-petkov/wfas/issues/42#issuecomment-793527446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4G3D4PRAGU2E6MZ52DRT3TCXKM7ANCNFSM4YNIY7XQ .
"Pickling" allows Python to save the state of an object and restore it later. We need some sort of functionality like this to allow NFDRS calculations to be stopped and started again from the saved state. We call this "State Saving". I 'think' we could use Pickling in Python to do this but it can't Pickle a SWIG-wrapped object very well. When you get time, could you look into this?
https://stackoverflow.com/questions/9310053/how-to-make-my-swig-extension-module-work-with-pickle