# Problem when using the Example Jupyter Notebooks for my own OpenMC

**URL:** <https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214>\
**Category:** User Support\
**Created:** [June 2, 2016, 9:07pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214 "2016-06-02T21:07:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/julien/32/1082_2.png) [@Julien](https://openmc.discourse.group/u/Julien)\
**Post date:** [June 2, 2016, 9:07pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214/1 "2016-06-02T21:07:51Z")

</div>

Hi all,

I am new to OpenMC and started by using the example in Jupyter Notebooks, MGXS Part I: Introduction (I basically copy-pasted the Python commands and added cross section path for NNC).

There are two problems:

First, the 2-groups cross section mean and standard deviation are obviously wrong :

Total cross section

> **Cell** | **Group In** | **Nuclide** | **Mean** | **Std. Dev.** |
> 
> - | - | - | - | - |  
> 1 | 1 | total | 0 | 0 |  
> 1 | 2 | total | 1.9599963723 | 0 |

Absorption cross section

> **Cell** | **Group In** | **Nuclide** | **Mean** | **Std. Dev.** |
> 
> - | - | - | - | - |  
> 1 | 1 | total | 1.79769313486232E+308 | 0 |  
> 1 | 2 | total | 0.0113877115 | 0 |

Secondly, and this is probably directly connected to the first problem, I have got warning from Python for the file tallies.py:

_/home/julien/openmc/openmc/tallies.py:359: RuntimeWarning: invalid value encountered in sqrt_  
_self.mean[nonzero]\*\*2)/(n - 1))_  
_/home/julien/openmc/openmc/tallies.py:1529: RuntimeWarning: invalid value encountered in true\_divide_  
_self\_rel\_err = data[‘self’][‘std. dev.’] / data[‘self’][‘mean’]_  
_/home/julien/openmc/openmc/tallies.py:1530: RuntimeWarning: invalid value encountered in true\_divide_  
_other\_rel\_err = data[‘other’][‘std. dev.’] / data[‘other’][‘mean’]_  
_/home/julien/openmc/openmc/tallies.py:1531: RuntimeWarning: invalid value encountered in true\_divide_  
_new\_tally.\_mean = data[‘self’][‘mean’] / data[‘other’][‘mean’]_  
_/home/julien/openmc/openmc/tallies.py:1108: RuntimeWarning: invalid value encountered in true\_divide_  
_data = self.std\_dev[indices] / self.mean[indices]_

For the very first warning (tallies.py line 359) I checked a little and it looks like there is a problem with sum\_sq in the calculation of the standard deviation. If I check the value of the mean (self.mean) it is 37.18195109. The square of the mean is then 1382.49748701. However, the mean of the square (self.sum\_sq[nonzero]/n) is 26.76525086. Obviously, the resulting difference in the root square is negative hence the warning and the NaN value that triggers the other warning.

If I understand correctly, it looks like sum\_sq is a value directly extracted by tallies.py from the HDF5 statepoint file. Could it be that tallies.py misread something here?

Your help would be very welcome.  
Let me know if you guys need more information from my OpenMC or my results.

Thanks a lot.

Julien

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 2, 2016, 9:10pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214/2 "2016-06-02T21:10:11Z")

</div>

Just a hunch – what version of h5py do you have installed?

---

<div class="post-metadata">

**Author:** ![Julien](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/julien/32/1082_2.png) [@Julien](https://openmc.discourse.group/u/Julien)\
**Post date:** [June 2, 2016, 9:28pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214/3 "2016-06-02T21:28:21Z")

</div>

Paul,

The version of h5py I have is 2.6.0-1.

Thanks.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 2, 2016, 9:33pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214/4 "2016-06-02T21:33:08Z")

</div>

h5py version 2.6.0 has a [known bug](https://github.com/h5py/h5py/issues/698) which affects compound datatypes and unfortunately bites us. It has been fixed, but there has been no new release yet so the best advice I can offer is to downgrade your h5py to 2.5.

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![Julien](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/julien/32/1082_2.png) [@Julien](https://openmc.discourse.group/u/Julien)\
**Post date:** [June 3, 2016, 5:19pm UTC](https://openmc.discourse.group/t/problem-when-using-the-example-jupyter-notebooks-for-my-own-openmc/214/5 "2016-06-03T17:19:56Z")

</div>

Paul,

I just installed h5py 2.5 and I now obtain results very close to the Jupyter Notebooks Example. Looks like it is working.

Thanks a lot for your help.

Julien
