[yt-users] pickle

Elizabeth Tasker tasker at astro1.sci.hokudai.ac.jp
Wed Nov 30 01:46:41 PST 2011


Hi,

A bigger problem....

The lastest version of yt

The current version of the code is:

---
a519b8754ba8 (yt) tip
---


has problems with pickle. If I pickle a data set and then try and
unpickle it, I see:

unpickle core data
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/home/tasker/yt/src/yt-hg/scripts/iyt in <module>()
    338
    339     #file = open('cores.pickle','rb')
--> 340     allcloudcores = cPickle.load(file('cores.pickle', 'rb'))
    341     file.close()
    342

/home/tasker/yt/src/yt-hg/yt/data_objects/data_containers.pyc in
_reconstruct_object(*args, **kwargs)
   3676         else: new_args.append(arg)
   3677     pfs = ParameterFileStore()
-> 3678     pf = pfs.get_pf_hash(pfid)
   3679     cls = getattr(pf.h, dtype)
   3680     obj = cls(*new_args)

/home/tasker/yt/src/yt-hg/yt/utilities/parameter_file_storage.pyc in
get_pf_hash(self, hash)
    106     def get_pf_hash(self, hash):
    107         """ This returns a parameter file based on a hash. """
--> 108         return self._convert_pf(self._records[hash])
    109
    110     def get_pf_ctid(self, ctid):

KeyError: (('283b7c4d88671dbff7acf083098da6ae',), <function
_reconstruct_object at 0x272c938>,
('283b7c4d88671dbff7acf083098da6ae', 'region', array([ 16.,  16.,
16.]), array([ 0.,  0.,  0.]), array([ 32.,  32.,  32.]),
{'disk_center': array([16, 16, 16]), 'center': array([ 16.,  16.,
16.]), 'bulk_velocity': array([ 0.,  0.,  0.]), 'disk_vector':
array([0, 0, 1]), 'disk_radius': array([  0.1   ,   0.1358,   0.1716,
 0.2074,   0.2432,   0.279 ,




The fact it mentions the field parameters in the last line, might mean
it's an error introduced because of the corrections to them (that I
have been demanding!)?

The script I have works fine (pickles and all) on yt version:

---
16e8d749a806 (yt) tip
---


Elizabeth



More information about the yt-users mailing list