[yt-dev] advice on derived field debugging

Kacper Kowalik xarthisius.kk at gmail.com
Thu Oct 2 07:10:33 PDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20141002/a50fe3aa/attachment.htm>


More information about the yt-dev mailing list