[yt-dev] advice on derived field debugging

Matthew Turk matthewturk at gmail.com
Thu Oct 2 07:03:38 PDT 2014


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?

>
> Thanks,
> Britton
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



More information about the yt-dev mailing list