[yt-users] unpickle / load problems

Matthew Turk matthewturk at gmail.com
Wed Mar 13 12:08:05 PDT 2013


Hi Elizabeth,

Okay, this seems like it's bumped up against a problem with the way yt
handles pickles.  At some point in the reconstruction, data objects
aren't getting separated from their parameter files.

Any chance you could make something that reproduces this on one of the
workshop datasets?

http://yt-project.org/data/

-Matt

On Wed, Mar 13, 2013 at 3:03 PM, Elizabeth Tasker
<tasker at astro1.sci.hokudai.ac.jp> wrote:
> Hi,
>
> I'm struggling to unpickle / load_object a previously pickled / save_object.
>
> I've done:
>
> pf.h.save_object(allclouds, "clouds_pyfindclouds2_yt")
>
> but when I do:
>
> clouds = pf.h.load_object("clouds_pyfindclouds2_yt")
>
> I get:
>
> AttributeError                            Traceback (most recent call last)
> /Users/Elizabeth/yt/src/yt-hg/scripts/iyt in <module>()
> ----> 1 execfile("cloud_surfacedensity_b.py")
>
> /Users/Elizabeth/yt/src/yt-hg/scripts/iyt in <module>()
>      13 #file.close()
>      14
> ---> 15 clouds = pf.h.load_object("clouds_pyfindclouds2_yt")
>
> /Users/Elizabeth/yt/src/yt-hg/yt/data_objects/hierarchy.pyc in load_object(self, name)
>     328         if obj is None:
>     329             return
> --> 330         obj = cPickle.loads(obj.value)
>     331         if iterable(obj) and len(obj) == 2:
>     332             obj = obj[1] # Just the object, not the pf
>
> /Users/Elizabeth/yt/src/yt-hg/yt/data_objects/data_containers.pyc in _reconstruct_object(*args, **kwargs)
>    4623     pf = pfs.get_pf_hash(pfid)
>    4624     cls = getattr(pf.h, dtype)
> -> 4625     obj = cls(*new_args)
>    4626     obj.field_parameters.update(field_parameters)
>    4627     return pf, obj
>
> /Users/Elizabeth/yt/src/yt-hg/yt/data_objects/data_containers.pyc in __init__(self, regions, fields, pf, **kwargs)
>    4046         self._all_overlap = []
>    4047         self._cut_masks = {}
> -> 4048         self._get_all_regions()
>    4049         self._make_overlaps()
>    4050         self._get_list_of_grids()
>
> /Users/Elizabeth/yt/src/yt-hg/yt/data_objects/data_containers.pyc in _get_all_regions(self)
>    4057             self._all_regions.append(item)
>    4058             # So cut_masks don't get messed up.
> -> 4059             item._boolean_touched = True
>    4060         self._all_regions = np.unique(self._all_regions)
>    4061
>
> AttributeError: ("'tuple' object has no attribute '_boolean_touched'", <function _reconstruct_object at 0x101dcd578>, ('73850deee907adf5217f43156c5057cd', 'boolean', [(GR_Enzo2_128amr5_zeus_turb_psupp_rr_0240, AMRCylinder (GR_Enzo2_128amr5_zeus_turb_psupp_rr_0240): center=[ 16.  16.  16.], _norm_vec=[ 0.  0.  1.], _radius=7.5, _height=0.100000208264), 'NOT', (GR_Enzo2_128amr5_zeus_turb_psupp_rr_0240, AMRCylinder (GR_Enzo2_128amr5_zeus_turb_psupp_rr_0240): center=[ 16.  16.  16.], _norm_vec=[ 0.  0.  1.], _radius=4.5, _height=0.100000208264)], {'bulk_velocity': array([ 0.,  0.,  0.]), 'center': array([ 0.5,  0.5,  0.5]), 'normal': array([ 0.,  0.,  1.])}))
>
>
>
> This is all on the same computer.
>
> Elizabeth
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list