[Yt-dev] Overloading EnzoStaticOutput causing problems with load

david collins antpuncher at gmail.com
Mon Oct 24 09:15:33 PDT 2011


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.



More information about the yt-dev mailing list