It may be easier to set the configuration variable using a config file:<div><br></div><div><span></span><a href="http://yt-project.org/docs/dev/reference/configuration.html">http://yt-project.org/docs/dev/reference/configuration.html</a><br>
<br>On Tuesday, January 21, 2014, Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Caroline,<div><br></div><div>There are two separate things happening here.  The first is that serializing data objects, which is what the save_object call is doing, was disabled as the default behavior a while back.  Fortunately, you can enable this by adding the following at the very top of your script:</div>

<div><div>from yt.config import ytcfg</div><div>ytcfg['yt', 'serialize'] = 'True'</div></div><div><br></div><div>Note, this needs to go above "from yt.mods import *" or any other yt imports you may do.</div>

<div><br></div><div>The second part is that, when enabled, this functionality appears to be broken.  I did a quick test myself with the clump finder using the cookbook script (after I added the above lines) and got the following error while trying to reload the object:</div>

<div><br></div><div><div>Traceback (most recent call last):</div><div>  File "find_clumps.py", line 71, in <module></div><div>    master_clump = pf.h.load_object('My_clumps')</div><div>  File "/Users/britton/Documents/work/yt/yt-2.x/src/yt-hg/yt/data_objects/hierarchy.py", line 322, in load_object</div>

<div>    obj = cPickle.loads(obj.value)</div><div>AttributeError: 'numpy.ndarray' object has no attribute 'value'</div></div><div><br></div><div>I do not think this is terribly difficult to fix.  Matt, can you comment on this?</div>

<div><br></div><div>Sorry for the troubles!</div><div><br></div><div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 3:54 PM, Caroline Van Borm <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'borm@astro.rug.nl');" target="_blank">borm@astro.rug.nl</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I just wanted to add to this that I also tried to save my clump object (called master_clump) using <master_clump.save_object("<u></u>myclumps", "myclumpsfile.cpkl")>. However, this gives the error: "AttributeError: 'Clump' object has no attribute 'save_object'". It is very inconvenient that I cannot save the clump object, as the clump finding takes quite long. Any ideas?<br>


<br>
Thank you!<br>
<br>
Cheers,<br>
Caroline<div><div><br>
<br>
<br>
On 17-Jan-14 14:16, Caroline Van Borm wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Sorry to bother you again, but I have another problem with the clump finder. I have been able to run the script to find the clumps, wrote them to a text file, and saved the clump object using <pf.h.save_object(master_<u></u>clump, 'myclumps')>. However, when I try to read the object back in and get the lowest clumps using<br>


<br>
    master_clump = pf.h.load_object('myclumps')<br>
    leaf_clumps = get_lowest_clumps(master_<u></u>clump)<br>
<br>
I get an error saying:<br>
    Traceback (most recent call last):<br>
      File "./findclumps.py", line 66, in <module><br>
        leaf_clumps = get_lowest_clumps(master_<u></u>clump)<br>
      File "/home/uni05/cborm/YT/yt-x86_<u></u>64/src/yt-hg/yt/analysis_<u></u>modules/level_sets/clump_<u></u>handling.py", line 209, in get_lowest_clumps<br>
        if clump.children is None or len(clump.children) == 0:<br>
    AttributeError: 'NoneType' object has no attribute 'children'<br>
<br>
Does this happen because the clump object didn't actually get saved? And how can I check whether it did or not?<br>
<br>
Thanks again!<br>
<br>
Cheers,<br>
Caroline<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="javascript:_e({}, 'cvml', 'yt-users@lists.spacepope.org');" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="javascript:_e({}, 'cvml', 'yt-users@lists.spacepope.org');" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div>