[yt-users] from yt.analysis_modules.api import EnzoSimulation

gso at physics.ucsd.edu gso at physics.ucsd.edu
Sat Apr 23 16:18:35 PDT 2011


Actually I just tried and you can use

from yt.mods impolrt *
pf = EnzoSimulation("par_file")

just skip the from yt.analysis_modules.api import EnzoSimulation
and it will work

From
G.S.

> I think having to import EnzoSimulation is the old YT, the newer YT you
> can just do
>
> from yt.mods import *
> pf = load("par_file")
> [mine is usually something like pf = load("DD0000/DD0000")]
>
> see if that works
>
> From
> G.S.
>
>> Hi,
>>
>> I just downloaded the latest
>> http://hg.enzotools.org/yt/raw/stable/doc/install_script.sh
>>
>> and installed YT. Now, my python script (at the end of the email) quits
>> with a "Segmentation fault" error at line-8 (yt.analysis_modules.api):
>>
>> [sagarwal at ember ~/junk]$ python colorbars.py parameterfile
>> Segmentation fault
>>
>> If I comment out line8, then (obviously) I get the following error:
>>
>> Adding gaussian at -2.0 with width 0.5 and colors (0.0, 0.0, 0.502,
>> 0.00031622776601683794)
>> Adding gaussian at 0.5 with width 0.5 and colors (0.85737517232758309,
>> 1.0, 0.12482388288648784, 0.005623413251903491)
>> Adding gaussian at 3.0 with width 0.5 and colors (0.99609999999999999,
>> 0.97250000000000003, 0.99609999999999999, 0.10000000000000001)
>> Traceback (most recent call last):
>>   File "colorbars.py", line 36, in <module>
>>     es = EnzoSimulation(par_file, get_redshift_outputs=True,
>> initial_redshift=50, final_redshift=0)
>> NameError: name 'EnzoSimulation' is not defined
>>
>> Any ideas?
>> Shankar
>>
>>
>> python_script...
>> -------------------------------------------------------------
>> import numpy as na
>> from yt.mods import *
>> import yt.visualization.volume_rendering.api as vr
>> import matplotlib.pylab as pl
>> import sys
>>
>> from yt.mods import *
>> from yt.visualization.image_writer import write_bitmap
>> from yt.analysis_modules.api import EnzoSimulation
>>
>> blah..blah...
>>
>> par_file = sys.argv[1]
>> es = EnzoSimulation(par_file, get_redshift_outputs=True,
>> initial_redshift=50, final_redshift=0)
>> -------------------------------------------------------------
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>





More information about the yt-users mailing list