Ability to load and add to PstFrom? #399
Replies: 4 comments 2 replies
-
I guess you could try pickling the PstFrom object at interim points. I have no idea if it would load safely and efficiently but might be an easy fist thing to try. |
Beta Was this translation helpful? Give feedback.
-
You could also get closer to rolling your own with Pst.add_pars and Pst.add_obs after you get a basic interface done with PstFrom (not that PstFrom makes basic interfaces!) |
Beta Was this translation helpful? Give feedback.
-
Pickling should work - generally any python object can be pickled. The only bummer is there is a lack of portability like form OS to OS and Py version to version (so some degree). But...for the purposes of not losing progress in a single script to be picked up again by the same env, that should work fine I think |
Beta Was this translation helpful? Give feedback.
-
@wkitlasten, did you explore pickling option? I wonder if the logger calls might get in the way of this approach. Presumably, the logging file would likely be closed and the loaded pickle would not have knowledge to reopen the log file. Perhaps we could have a little method to relaunch a logfile (if existing) and attach to the reloaded PstFrom object to support further add_parameters() or add_observations() call etc. Thoughts @jtwhite79? |
Beta Was this translation helpful? Give feedback.
-
The real selling point for PstFrom is the ability to easily parameterize and pestify models with heaps of pars and obs. I find my script crashing more than I like to admit and usually well into the script after a substantial amount of time/comp. When it crashes it requires starting over entirely due to "I/O error on closed file." It would be handy to be able to do it in steps, for starters the ability to do pars separate from obs... that is, save the pst file with pars only (maybe dummy obs for a test run), then load the same pst file into a PstFrom object to add observations. I imagine it would also be handy to load an existing PstFrom instance and add additional pars/obs using the bells and whistles in PstFrom.
Does this functionality exist and I am just missing it?
Beta Was this translation helpful? Give feedback.
All reactions