[yt-users] pickling clumps
Britton Smith
brittonsmith at gmail.com
Thu May 27 18:43:45 PDT 2010
Hi Chris,
YT has its own routine designed to pickle data objects for saving and
reloading. For a given pf, you can do pf.h.save_object(object, name) and
the object will be saved to the .yt file associated with the dataset. You
can then get it back with object = pf.h.load_object(name). I have used this
successfully to save the mast_clump structure from clump finding.
Britton
On Thu, May 27, 2010 at 9:26 PM, Charles Hansen
<chansen at astro.berkeley.edu>wrote:
> The find_clumps function is working correctly for me I believe, but the
> analysis takes a very long time and I'd like to save the master_clump object
> (from
> http://yt.enzotools.org/doc/cookbook/recipes.html#cookbook-find-clumps)
> for further analysis. I've tried pickling master_clump. It dumps
> correctly, but gives an EOF error (below) on loading. Is there another way
> to save master_clump?
>
> Thanks,
> Charles
>
> /nics/c/home/chansen/lib/yt/lib/python2.6/pickle.pyc in load(file)
> 1368
> 1369 def load(file):
> -> 1370 return Unpickler(file).load()
> 1371
> 1372 def loads(str):
>
> /nics/c/home/chansen/lib/yt/lib/python2.6/pickle.pyc in load(self)
> 856 while 1:
> 857 key = read(1)
> --> 858 dispatch[key](self)
> 859 except _Stop, stopinst:
> 860 return stopinst.value
>
> /nics/c/home/chansen/lib/yt/lib/python2.6/pickle.pyc in load_eof(self)
> 878
> 879 def load_eof(self):
> --> 880 raise EOFError
> 881 dispatch[''] = load_eof
> 882
>
> EOFError:
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20100527/a7dbb47b/attachment.htm>
More information about the yt-users
mailing list