[Yt-dev] Overloading EnzoStaticOutput causing problems with load
david collins
antpuncher at gmail.com
Mon Oct 24 09:31:27 PDT 2011
> The kwargs support for load was added to support the use case of
> supplying units as well as supplying additional information that is
> required for instantiated some parameter files.
Ah, so could I pass the same conversion_override and
parameter_override arguments to load? That's an easy enough
modification to make.
d.
>
> -Matt
>
> On Mon, Oct 24, 2011 at 12:15 PM, david collins <antpuncher at gmail.com> wrote:
>> Hi, Everybody--
>>
>> In order to get units to be converted properly for fields that do not
>> have units information in the parameter file, I've been subclassing
>> EnzoStaticOutput. However, for some reason this shorts out the load
>> function. For instance merely subclassing EnzoStaticOutput as follows
>> causes load to return None, instead of a parameter file. This changed
>> some time ago, but I've been ignoring it. Is there a way I can
>> continue subclassing the EnzoStaticOutput, so I have more control over
>> my units and not lose the load function?
>>
>> Thanks,
>> d.
>>
>>
>> from yt.mods import *
>> class FileStaticOutputFourPi(EnzoStaticOutput):
>> def __init__(self,*args,**kwargs):
>> fpi = na.sqrt(4*na.pi)
>> EnzoStaticOutput.__init__(self,*args,conversion_override={'Density': 1,
>> 'DivB': 1,
>> 'x-velocity': 1,
>> 'Total_Energy': 1},
>> parameter_override={'LengthUnits':
>> 1,'LengthUnit': 1,
>> 'Time': 1},
>> **kwargs)
>>
>>>>> pf = load(path)
>>>>> print pf
>> None
>> --
>> Sent from my computer.
>> _______________________________________________
>> 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
>
--
Sent from my computer.
More information about the yt-dev
mailing list