openmc-plot-mesh-tally

Hello, I am trying to follow the guide here https://openmc.readthedocs.io/en/stable/usersguide/processing.html?highlight=plot%20tallies

plotting in 2D.

I want to plot a mesh tally in two dimension. I am running the

openmc-plot-mesh-tally

directly in my project directory. I got this below error

Sharifs-MacBook-Pro:JSA sharifabudarda$ openmc-plot-mesh-tally

/Users/sharifabudarda/miniconda3/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.

from ._conv import register_converters as _register_converters

2018-10-18 13:27:58.800 python[5891:300094] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f95bf05efd0

2018-10-18 13:27:58.804 python[5891:300094] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f95bf05efd0’

*** First throw call stack:

(

0 CoreFoundation 0x00007fff3bbbd571 __exceptionPreprocess + 256

1 libobjc.A.dylib 0x00007fff67b6aefb objc_exception_throw + 48

2 CoreFoundation 0x00007fff3bc3aca5 -[NSObject(NSObject) __retain_OA] + 0

3 CoreFoundation 0x00007fff3bb5c7fe forwarding + 1468

4 CoreFoundation 0x00007fff3bb5c1b8 _CF_forwarding_prep_0 + 120

5 libtk8.6.dylib 0x00000001092bd46f TkpInit + 383

6 libtk8.6.dylib 0x000000010921621e Initialize + 2622

7 _tkinter.cpython-36m-darwin.so 0x000000010903ca16 _tkinter_create + 1174

8 python 0x0000000107fe0b78 _PyCFunction_FastCallDict + 200

9 python 0x00000001080b824f call_function + 143

10 python 0x00000001080b5f4c _PyEval_EvalFrameDefault + 47100

11 python 0x00000001080a9589 _PyEval_EvalCodeWithName + 425

12 python 0x00000001080b8e15 _PyFunction_FastCallDict + 373

13 python 0x0000000107f5ee80 _PyObject_FastCallDict + 320

14 python 0x0000000107f86468 method_call + 136

15 python 0x0000000107f664ee PyObject_Call + 62

16 python 0x0000000108008065 slot_tp_init + 117

17 python 0x000000010800c5b1 type_call + 241

18 python 0x0000000107f5edf1 _PyObject_FastCallDict + 177

19 python 0x00000001080b8348 call_function + 392

20 python 0x00000001080b5f4c _PyEval_EvalFrameDefault + 47100

21 python 0x00000001080a9589 _PyEval_EvalCodeWithName + 425

22 python 0x00000001080a3d99 builtin_exec + 345

23 python 0x0000000107fe0b78 _PyCFunction_FastCallDict + 200

24 python 0x00000001080b824f call_function + 143

25 python 0x00000001080b5f4c _PyEval_EvalFrameDefault + 47100

26 python 0x00000001080b85fc fast_function + 188

27 python 0x00000001080b82ac call_function + 236

28 python 0x00000001080b5f4c _PyEval_EvalFrameDefault + 47100

29 python 0x00000001080b85fc fast_function + 188

30 python 0x00000001080b82ac call_function + 236

31 python 0x00000001080b5f4c _PyEval_EvalFrameDefault + 47100

32 python 0x00000001080a9589 _PyEval_EvalCodeWithName + 425

33 python 0x000000010810163c PyRun_FileExFlags + 252

34 python 0x0000000108100dee PyRun_SimpleFileExFlags + 366

35 python 0x0000000108126dd6 Py_Main + 3718

36 python 0x0000000107f56e7d main + 509

37 libdyld.dylib 0x00007fff68c31085 start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

Abort trap: 6

What I do here? Thanks.

Looks like this could be a bug in openmc-plot-mesh-tally. See this stack overflow post with a similar problem and solution. If you’re comfortable, you can try making changes in the openmc-plot-mesh-tally script, adding the following:

import matplotlib
matplotlib.use(“TkAgg”)

Hello Dr, i was using mac system when i post this. In mac system this does not work and shows this error. I move into my linux system and run the same command there. It worked. In both platform i have openmc veraion 10 installed. I will follow up with your guide above. Thanks for the reply.

Hello, Dr, Can you share me the directory of the script file stored in? I am in mac OS X10.14. I have miniconda3 installed. I looked for the main script file I found two of the script

‎⁨MAC OS X⁩ ▸ ⁨Users⁩ ▸ ⁨xxxxx ▸ ⁨miniconda3⁩ ▸ ⁨pkgs⁩ ▸ ⁨openmc-0.10.0-0⁩ ▸ ⁨lib⁩ ▸ ⁨python3.6⁩ ▸ ⁨site-packages⁩ ▸ ⁨openmc-0.10.0-py3.6-macosx-10.9-x86_64.egg-info⁩ ▸ ⁨scripts⁩

and another one is on

‎⁨MAC OS X⁩ ▸ ⁨Users⁩ ▸ ⁨sharifabudarda⁩ ▸ ⁨miniconda3⁩ ▸ ⁨pkgs⁩ ▸ ⁨openmc-0.10.0-py36hb8ecfd0_2⁩ ▸ ⁨lib⁩ ▸ ⁨python3.6⁩ ▸ ⁨site-packages⁩ ▸ ⁨openmc-0.10.0-py3.6-macosx-10.9-x86_64.egg-info⁩ ▸ ⁨scripts⁩

I tried to change in both of them as the below image shows. Please reply if I am doing right. This is only in mac OS. In linux, it works. Thanks.

2.png

I’m not too sure about the exact path on macOS, but in your case I would probably just change it in both. The change that you made looks correct to me.

Best,
Paul

Hello, Dr, Ok, I did update of the miniconda packages by

conda update conda

and also the openmc package by

conda update openmc

I also installed vtk package for conda and also update python package

now, if I run the openmc-plot-mesh-tally I am having a different issue. The log is below. can you guide what I can do here? Thanks.

Sharifs-MBP:JSA sharifabudarda$ openmc-plot-mesh-tally statepoint.555.h5

Traceback (most recent call last):

File “/Users/sharifabudarda/miniconda3/bin/openmc-plot-mesh-tally”, line 4, in

import(‘pkg_resources’).run_script(‘openmc==0.10.0’, ‘openmc-plot-mesh-tally’)

File “/Users/sharifabudarda/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py”, line 750, in run_script

self.require(requires)[0].run_script(script_name, ns)

File “/Users/sharifabudarda/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py”, line 1527, in run_script

exec(code, namespace, namespace)

File “/Users/sharifabudarda/miniconda3/lib/python3.6/site-packages/openmc-0.10.0-py3.6-macosx-10.9-x86_64.egg-info/scripts/openmc-plot-mesh-tally”, line 15, in

from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg

ImportError: cannot import name ‘NavigationToolbar2TkAgg’

Hello Dr, I was able to resolve the issue. Here is what I did, In

“/Users/sharifabudarda/miniconda3/lib/python3.6/site-packages/openmc-0.10.0-py3.6-macosx-10.9-x86_64.egg-info/scripts/openmc-plot-mesh-tally” I changed the

NavigationToolbar2TkAgg
into
NavigationToolbar2Tk

That does it. For me, Now I am able to run openmc-plot-mesh-tally command. Thanks for your guide.

https://stackoverflow.com/questions/50330320/what-to-use-instead-of-navigationtoolbar2tkagg

this link has the solution