[yt-users] Another clump finder error

Nathan Goldbaum nathan12343 at gmail.com
Tue Jan 21 10:27:13 PST 2014


It may be easier to set the configuration variable using a config file:

http://yt-project.org/docs/dev/reference/configuration.html

On Tuesday, January 21, 2014, Britton Smith <brittonsmith at gmail.com> wrote:

> Hi Caroline,
>
> 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:
> from yt.config import ytcfg
> ytcfg['yt', 'serialize'] = 'True'
>
> Note, this needs to go above "from yt.mods import *" or any other yt
> imports you may do.
>
> 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:
>
> Traceback (most recent call last):
>   File "find_clumps.py", line 71, in <module>
>     master_clump = pf.h.load_object('My_clumps')
>   File
> "/Users/britton/Documents/work/yt/yt-2.x/src/yt-hg/yt/data_objects/hierarchy.py",
> line 322, in load_object
>     obj = cPickle.loads(obj.value)
> AttributeError: 'numpy.ndarray' object has no attribute 'value'
>
> I do not think this is terribly difficult to fix.  Matt, can you comment
> on this?
>
> Sorry for the troubles!
>
> Britton
>
>
> On Tue, Jan 21, 2014 at 3:54 PM, Caroline Van Borm <borm at astro.rug.nl<javascript:_e({}, 'cvml', 'borm at astro.rug.nl');>
> > wrote:
>
>> Hi all,
>>
>> I just wanted to add to this that I also tried to save my clump object
>> (called master_clump) using <master_clump.save_object("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?
>>
>> Thank you!
>>
>> Cheers,
>> Caroline
>>
>>
>>
>> On 17-Jan-14 14:16, Caroline Van Borm wrote:
>>
>>> Hi all,
>>>
>>> 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_clump,
>>> 'myclumps')>. However, when I try to read the object back in and get the
>>> lowest clumps using
>>>
>>>     master_clump = pf.h.load_object('myclumps')
>>>     leaf_clumps = get_lowest_clumps(master_clump)
>>>
>>> I get an error saying:
>>>     Traceback (most recent call last):
>>>       File "./findclumps.py", line 66, in <module>
>>>         leaf_clumps = get_lowest_clumps(master_clump)
>>>       File "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_
>>> modules/level_sets/clump_handling.py", line 209, in get_lowest_clumps
>>>         if clump.children is None or len(clump.children) == 0:
>>>     AttributeError: 'NoneType' object has no attribute 'children'
>>>
>>> Does this happen because the clump object didn't actually get saved? And
>>> how can I check whether it did or not?
>>>
>>> Thanks again!
>>>
>>> Cheers,
>>> Caroline
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org <javascript:_e({}, 'cvml',
>>> 'yt-users at lists.spacepope.org');>
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org <javascript:_e({}, 'cvml',
>> '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/20140121/afd885f7/attachment.html>


More information about the yt-users mailing list