Correct way to save, and load, data from file. #160
-
Hi All, First, this package is really great, thanks David and other developers for making it available! I have a question about the right way to save and load data (having read #39 already). I'm running a sim, saving data to disk, as so:
Having saved the simulation results to disk, I want to load them and analyse them at a later time (i.e. a fresh python instance). I'm loading data from disk as so:
Having loaded storage in this way, If I try running through a generator to get (field,time) pairs:
I get an error:
I guess this is related to #39 , and this grid attribute not being set. My question is: What is the right way of setting this grid key in the FileStorage instance, so I can safely yield (time, value) pairs? More generally, is this the right way of loading data having run a simulation? [I see that I can access the underlying FieldStorage.data, but this feels dangerous.] Any help much appreciated, thanks again. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This was indeed a bug, but should be fixed in the latest version of |
Beta Was this translation helpful? Give feedback.
This was indeed a bug, but should be fixed in the latest version of
py-pde
. Conda has not yet updated the package, but the master branch andpip
should have it. After updating, you should be able to load the stored data.