Problem with pickling/unpickling

Hi guys,

somehow, I experience problems with unpickling a grid function :wink:
Attached you’ll find a pickled gridfunction in the .dat (remove the .txt at the end of the filename first) file and a python script for loading it.
In the past, loading it like this worked just fine - do you have an idea why it is not working anymore?
Am I doing something wrong here?

Thanks for your help!

Best, Philipp


Attachment: gfu-pickle.dat.txt

Hi Philipp,
we were working on the pickling the last weeks, and the format changed (and will still change). You need the same Netgen/NGSolve version with which you created the pickle-file.
Backward compatibility is on the wish list :slight_smile:

Hi Joachim,
thanks for the quick answer.
Is there any way to figure out with which Netgen/NGSolve version a particular pickle has been written? Unfortunately, I usually compute on different systems with different versions all the time which might be a problem in this case… :wink:
Best, Philipp

Hi Philipp,
we changed some of the pickling to be more efficient (pickling vectors without copying and memory allocation,…) on 1st March. Because of this we had to do some more invasive changes to how we use the pickling library. I’ve just pushed a merge request because the GF wasn’t actually using the new structures (so if you update in the next week or so it will again not be compatible with older versions). So pickling is still experimental, I think that we can provide a stable pickling environment from the user meeting on. Your file is readable with v6.2.1802, so before the changes on 1st March.
Sorry for the inconvenience.
Best, Christopher

Hi Christopher,
thanks for your help.
Now, I have it working :slight_smile:
Best, Philipp