[yt-users] Unpickling phase plots

david collins antpuncher at gmail.com
Fri Jul 1 08:55:44 PDT 2011


Hi there--

I have a phase plot that I pickled on one machine, and moved to my
laptop and want to re-plot.  I pickled it like this:
fptr=open(filename,'rb')
cPickle.dump(pc.plots[-1].data,fptr,protocol=-1)

I want to unpickle it like this:
obj = cPickle.load( open(filename) )

but I get this parameter file error (full traceback below):

return self._convert_pf(self._records[hash])
KeyError: (('32aa7d1d4941760ffd8fdcab4ea97e1f',), <function
_reconstruct_pf at 0x101f9d050>,
('32aa7d1d4941760ffd8fdcab4ea97e1f',))

I suspect that the key error is because I don't have the original
dataset on this machine (due to disk space) so the pf store on this
machine doesn't have that key.  Does that sound right, and is there a
work around for that?

This is a technique I've used in the past, so in principle it's sound.

Thanks,
d.

Full trace:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "p8_theta_coarse.py", line 6, in <module>
    phase = fPickle.load(infile)
  File "/Users/dcollins/Sites/Research/CodeGames/yt2.0/fPickle.py",
line 9, in load
    output = cPickle.load(inputfile,*args,**kwargs)
  File "/Users/dcollins/local/lib/python2.6/site-packages/yt-2.1dev-py2.6-macosx-10.4-i386.egg/yt/data_objects/static_output.py",
line 192, in _reconstruct_pf
    pf = pfs.get_pf_hash(*args)
  File "/Users/dcollins/local/lib/python2.6/site-packages/yt-2.1dev-py2.6-macosx-10.4-i386.egg/yt/utilities/parameter_file_storage.py",
line 104, in get_pf_hash
    return self._convert_pf(self._records[hash])
KeyError: (('32aa7d1d4941760ffd8fdcab4ea97e1f',), <function
_reconstruct_pf at 0x101f9d050>,
('32aa7d1d4941760ffd8fdcab4ea97e1f',))


-- 
Sent from my computer.



More information about the yt-users mailing list