[yt-dev] advice on derived field debugging

Kacper Kowalik xarthisius.kk at gmail.com
Thu Oct 2 11:42:34 PDT 2014


On Thu, Oct 2, 2014 at 12:37 PM, Britton Smith <brittonsmith at gmail.com>
wrote:

> Hi Kacper, Matt,
>
> Yes, that fixes the problem, although I am rather confused as to why.  The
> nuclei density fields depend on the species fields, so I would have thought
> that the species fields need to be added first.  Can someone explain what
> is happening here?
>

If species list is empty (calling add_nuclei_dens... will do that), there's
a fallback that adds ["H", "He"] at  yt/fields/species_fields.py:123.
I should be clear that what I've suggested was merly a workaround.

Cheers,
Kacper


> Britton
>
> On Thu, Oct 2, 2014 at 9:10 AM, Kacper Kowalik <xarthisius.kk at gmail.com>
> wrote:
>
>> On Thu, Oct 2, 2014 at 9:03 AM, Matthew Turk <matthewturk at gmail.com>
>> wrote:
>>
>>> Hi Britton,
>>>
>>> On Thu, Oct 2, 2014 at 8:34 AM, Britton Smith <brittonsmith at gmail.com>
>>> wrote:
>>> > Hi all,
>>> >
>>> > There seems to be an issue accessing the nuclei density fields.  These
>>> are
>>> > derived fields that give the total number density of an element with
>>> names
>>> > like "H_nuclei_density."  At some point, these have stopped working
>>> and I am
>>> > trying to debug this.  To reproduce this, one can do the following:
>>> > ds = yt.load("enzo_cosmology_plus/DD0046/DD0046")
>>> > ad = ds.all_data()
>>> > ad["H_nuclei_density"]
>>> >
>>> > I have traced this as far as the following.  In the call to
>>> > create_field_info, a YTFieldNotFound exception is raised on line 137 of
>>> > yt/fields/species_fields.py.  Here, the nuclei density field function
>>> is
>>> > trying to access a number density field that should exist, but doesn't
>>> seem
>>> > to at the moment.  Later on it does, but not at this moment.  Does
>>> anyone
>>> > have any advice for where to look next?
>>>
>>> It might have to do with the order of field addition.  When does the
>>> field actually get added?  Can you insert pdb calls into add_field
>>> whenever the field you're looking for is added, and see when it occurs
>>> compared to when the other one does?
>>>
>>
>> Hi Britton,
>> it's just as Matt suggested. Creating nuclei fields prior to species
>> fields fixes the issue:
>>
>> http://paste.yt-project.org/show/5143/
>>
>> Cheers,
>> Kacper
>>
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>
>>
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20141002/b2b2747b/attachment.htm>


More information about the yt-dev mailing list