[yt-users] izip not defined

Matthew Turk matthewturk at gmail.com
Fri Jan 7 11:12:46 PST 2011


Hi G.S.,

On Fri, Jan 7, 2011 at 2:09 PM,  <gso at physics.ucsd.edu> wrote:
> Thanks, it's working perfectly as before now on my laptop (got 2.0dev
> installed on laptop with no prob), but can the changes be updated on
> Triton, too?

Yes.

>
> Another follow-up question I have is, when I do
> new_region = dd.extract_connected_sets(field, num_levels, ion_min,
> ion_max)[1][0]
> pf.h.save_object(new_region, file+"_new_region")
>
> Should I specify this with :func:only_on_root to avoid many processors
> writing to the .yt file or is this already by default?

This is already the default.

>
> And since the projections are parallelized, are volume rendering or
> extracted_connected_set also parallelized?
>

Volume rendering is, but e_c_s is not.  I have hopes of parallelizing
it and implementing a new algorithm for that functionality, but I'm
not sure what the timescale for that is.

-Matt

> From
> G.S.
>
>> Hi G.S.,
>>
>> On Thu, Jan 6, 2011 at 7:53 PM,  <gso at physics.ucsd.edu> wrote:
>>> My script that called on extract_connected_set is running into a problem
>>> in the 2.0dev version of yt which was fine on my laptop running the old
>>> svn trunk.  It said that izip is not defined.  I looked around the
>>> source
>>> code and found some instances of izip, and they all called import before
>>> using it, so I tried to add
>>>
>>> from itertools import izip
>>>
>>> but that didn't work either.  Am I just doing something wrong
>>> transitioning to 2.0?
>>
>> Nope, it was a now-fixed import error.
>>
>>> In the script, when calling pf.h.all_data(), it
>>> gives me the following:
>>> Warning: invalid value encountered in sqrt
>>> It's an annoyance but does not crash the script.
>>
>> I too was seeing these, and I managed to track them down a few weeks
>> ago.  They come from the detection of available derived fields; I got
>> rid of one or two, but the remaining issue is with the detection of
>> the "Radius" field.  They're harmless and won't cause any problems.
>>
>> -Matt
>>
>>>
>>> From
>>> G.S.
>>>
>>> Traceback pasted to http://paste.enzotools.org/show/1lxPqc1vtFgggGN3jwPr
>>>
>>> script:
>>>
>>>
>>> from yt.mods import * # set up our namespace
>>> #from itertools import izip
>>> #from yt.lagos.DerivedQuantities import *
>>>
>>> def IonizedFraction(field, data):
>>>   return 1-data["HI_Density"]/data["Density"]
>>>
>>> add_field("IonizedFraction", function=IonizedFraction,
>>> units=r"\frac{\rho_{HII}}{\rho}")
>>>
>>> def NeutralFraction(field, data):
>>>   return data["HI_Density"]/data["Density"]
>>>
>>> add_field("NeutralFraction", function=NeutralFraction,
>>> units=r"\frac{\rho_{HI}}{\rho}")
>>>
>>> min_output_number = 273
>>> max_output_number = 273
>>> skip = 1
>>>
>>> for i in range(min_output_number, max_output_number+1, skip):
>>>
>>>
>>>    file = "DD%04i" % i
>>>
>>>    fn = file+"/"+file
>>>
>>>    pf = load(fn)
>>>
>>>    field = "IonizedFraction"
>>>
>>>    step = 100.0
>>>
>>>    dd = pf.h.all_data()
>>>
>>>    ion_min = 0.01
>>>    ion_max = 1.0
>>>    num_levels = 1
>>>
>>>    new_region = dd.extract_connected_sets(field, num_levels, ion_min,
>>> ion_max)[1][0]
>>>
>>>    pf.h.save_object(new_region, file+"_new_region")
>>>    pf.h.save_object(ion_min, file+"_ion_min")
>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> 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
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
> _______________________________________________
> 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