[Yt-dev] Gas_Energy

david collins antpuncher at gmail.com
Fri Jun 26 16:06:56 PDT 2009


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.



More information about the yt-dev mailing list