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

Matthew Turk matthewturk at gmail.com
Mon Apr 25 09:50:17 PDT 2011


Hi Shankar,

This is a worrisome error.  Please leave in the import in your script
and run it like this:

gdb python

At the gdb prompt, type "run my_script.py" where "my_script.py" is your script.

When it segfaults, type:

bt

And then send that here, to the list.

Best,

Matt

On Sun, Apr 24, 2011 at 12:34 AM, Agarwal, Shankar <sagarwal at ku.edu> wrote:
> Hi G.S.
>
> Unfortunately, that did not work. If I skip "from yt.analysis_modules.api import EnzoSimulation", then i get the following error:
>
> NameError: name 'EnzoSimulation' is not defined
>
>
> [sagarwal at ember ~/junk]$ python
> Python 2.7.1 (r271:86832, Apr 23 2011, 12:22:34)
> [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from yt.mods import *
>>>> import numpy as na
>>>> import yt.visualization.volume_rendering.api as vr
>>>> import matplotlib.pylab as pl
>>>> import sys
>>>> from yt.visualization.image_writer import write_bitmap
>>>> from yt.analysis_modules.api import EnzoSimulation
> Segmentation fault
>
>
> For reference, the script I am talking about is http://paste.enzotools.org/show/1580/
>
> Shankar
> ________________________________________
> From: yt-users-bounces at lists.spacepope.org [yt-users-bounces at lists.spacepope.org] on behalf of gso at physics.ucsd.edu [gso at physics.ucsd.edu]
> Sent: Saturday, April 23, 2011 6:18 PM
> To: Discussion of the yt analysis package
> Subject: Re: [yt-users] from yt.analysis_modules.api import EnzoSimulation
>
> 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
>>
>
>
> _______________________________________________
> 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