[Yt-dev] Gas_Energy

Matthew Turk matthewturk at gmail.com
Fri Jun 26 16:10:25 PDT 2009


Hi Dave,

I'm going to be away this weekend, but this sort of thing is exactly
what @print_tb and @pdb_run were designed for.  If you can post a way
to reproduce your problem in a minimal environment, we can all take a
look, but I'd recommend you start there and figure out where your
field is being added (to which object) and how yt is accessing the
field for the data object you are querying.

http://yt.enzotools.org/browser/trunk/yt/funcs.py#L107
http://yt.enzotools.org/browser/trunk/yt/funcs.py#L202

-Matt


On Fri, Jun 26, 2009 at 4:06 PM, david collins<antpuncher at gmail.com> wrote:
> Hi--
>
> I ran into a recursion limit in trying to access Gas_Energy-- I
> believe it has something to do with the workaround for the underscore
> in GasEnergy.  I'm using code that worked at some time before April,
> but has since stopped, I believe that the 'working' code didn't have
> the "Gas_?Energy" update.
>
> I've overloaded GasEnergy in my plugins.py to return isothermal gas
> energy, since I don't have a GasEnergy field (or a TotalEnergy, for
> that matter) in my simulations.  However, when I now go to access it,
> I get stuck in the ping pong between "GasEnergy" and "Gas_Energy" in
> EnzoFields.py:
>
> def _GasEnergy(field, data):
>    return data["Gas_Energy"] / _convertEnergy(data)
> add_field("GasEnergy", function=_GasEnergy,
>          units=r"\rm{ergs}/\rm{g}", convert_function=_convertEnergy)
>
> def _Gas_Energy(field, data):
>    return data["GasEnergy"] / _convertEnergy(data)
> add_field("Gas_Energy", function=_Gas_Energy,
>          units=r"\rm{ergs}/\rm{g}", convert_function=_convertEnergy)
>
> instead of using my own field.  Why doesn't it take mine first, before
> looking in EnzoFields.py?  Is there a way to force this behavior?
>
> Thanks,
> d.
> _______________________________________________
> 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