我一直在使用这个python程序来查找我的文件的max_dens,但是每当我执行该文件时,我都会得到相同的错误。谁能告诉我这些错误指的是什么?我使用的是yt 3.1
计算并绘制最大密度随时间的变化。 导入yt #import LibCartesian3D matplotlib matplotlib.use('Agg')导入matplotlib.pyplot作为matplotlib.pyplot导入,将numpy导入为np flashFolder =‘flashFolder/work/03858/thaque56 56/run_149/’basename = 'super3d_‘#设置plotfile和检查点文件的前缀。通常“super3d_”代表MHD,“relax_”代表纯净水。useAllPlotfiles = False # set使用glob.glob选择plotfile (默认情况下使用所有可用文件) endcount =5#指定是否为useAllPlotfiles == False,给出使用的最后一个============================构造文件列表,如果脚本是独立运行的,否则由allPlots.py提供!def getfilenames( useAllPlotfiles,endcount):如果useAllPlotfiles == True: plotFilenames_own = glob.glob(flashFolder + basename + 'hdf5_plt_cnt_0-90-9') plotFilenames_own.sort() plotFilenames_own.sort() for : plotFilenames_own = [] in范围(0,endcount +1:文件名= flashFolder + basename + 'hdf5_plt_cnt_%04d‘%n plotFilenames_own.append(文件名)返回plotFilenames_own #============================ def main(文件名):print 'Executing maxDens.py’max_dens =np.zeros(文件名)time =np.zeros(len(文件名))表示n in范围(len(文件名)):pf =yt.load(filenamesn) timen = pf.current_time dens_max,dens_max_location = pf.h.find_max('dens') max_densn = dens_max打印时间,max_dens plt.plot(时间,( max_dens) plt.xlabel('time s') plt.ylabel('density g/cm^3') plt.title(‘随着时间的最大密度’) plt.savefig('MaxDens.png')如果__name__ == "__main__":plotFilenames_own = getfilenames(useAllPlotfiles,endcount) main(plotFilenames_own)
为了您的方便,我也附加了错误。
退出TACC: Starting up job 6517689 > TACC: Setting up parallel environment for MVAPICH2+mpispawn. > TACC: Starting parallel tasks... > Traceback (most recent call last): > File "maxDens.py", line 3, in <module> > import yt > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/\_\_init\_\_.py", > line 121, in <module> > from yt.data\_objects.api import \ > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/data\_objects/api.py", > line 51, in <module> > from . import construction\_data\_containers as \_\_cdc > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/data\_objects/construction\_data\_containers.py", > line 52, in <module> > from yt.frontends.stream.api import load\_uniform\_grid > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/frontends/stream/api.py", > line 16, in <module> > from .data\_structures import \ > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/frontends/stream/data\_structures.py", > line 38, in <module> > from yt.geometry.grid\_geometry\_handler import \ > File "/work/03858/thaque56/sw/yt-3.1/yt-x86\_64/src/yt-hg/yt/geometry/grid\_geometry\_handler.py", > line 38, in <module> > from .grid\_container import \ > File "yt/geometry/selection\_routines.pxd", line 34, in init yt.geometry.grid\_container (yt/geometry/grid\_container.c:9108) > ValueError: yt.geometry.selection\_routines.SelectorObject has the wrong size, try recompiling > [c557-601.stampede.tacc.utexas.edu:mpispawn\_0][child\_handler] MPI 进程(秩: 0,pid: 130364),状态为1 TACC: MPI作业退出代码:1 TACC:关闭完成。正在退出。
请帮我解决这个问题。我认为yt版本有一些问题。
发布于 2016-02-07 16:34:01
问题是,使用cython生成的一些C扩展yt使用需要重新编译。原来,clean.sh脚本并没有删除这些内容,所以您必须像这样清理它们:
$ cd /work/03858/thaque56/sw/yt-3.1/yt-x86_64/src/yt-hg/
$ hg --config extensions.purge= purge --all yt
$ python setup.py develop抱歉,昨晚在yt邮件列表上给了你糟糕的建议!希望这能帮你解决问题。
https://stackoverflow.com/questions/35238402
复制相似问题