# Openmc-ace-to-hdf5 error

**URL:** <https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040>\
**Category:** User Support\
**Created:** [February 28, 2021, 11:13pm UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040 "2021-02-28T23:13:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerio69](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/valerio69/32/1192_2.png) [@valerio69](https://openmc.discourse.group/u/valerio69)\
**Post date:** [February 28, 2021, 11:13pm UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040/1 "2021-02-28T23:13:59Z")

</div>

Hi All,  
I’m trying to convert ACE MCNP cross-sections into HDF5 format.  
The command is the following:  
openmc-ace-to-hdf5 -d ./ --xsdir …/mu2e\_xsdata/xsdirendf80

Unfortunately, the script does not start returning the following error:  
Traceback (most recent call last):  
File “/usr/local/bin/openmc-ace-to-hdf5”, line 73, in   
if not os.path.exists(path):  
File “/usr/lib/python3.5/genericpath.py”, line 19, in exists  
os.stat(path)  
TypeError: argument should be string, bytes or integer, not PosixPath

I can’t figure out what’s the problem. I’m using the script released with version 0.12.0 of the code.  
Let me know if more information is necessary.  
Thanks  
Valerio

---

<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:** [March 2, 2021, 12:52pm UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040/2 "2021-03-02T12:52:09Z")

</div>

It looks like the `openmc-ace-to-hdf5` script does not support your Python version (3.5). The [`os.path.exists`](https://docs.python.org/3/library/os.path.html#os.path.exists) function started accepting path-like objects in Python 3.6. Are you able to use Python 3.6 or higher? If not, you can try copying the `openmc-ace-to-hdf5` script somewhere else and modifying the problematic line (73) to:

```auto
if not os.path.exists(str(path)):

```

---

<div class="post-metadata">

**Author:** ![valerio69](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/valerio69/32/1192_2.png) [@valerio69](https://openmc.discourse.group/u/valerio69)\
**Post date:** [March 2, 2021, 3:58pm UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040/3 "2021-03-02T15:58:23Z")

</div>

Thanks Paul,

that’s probably the problem, as the same script worked perfectly on a different machine with python 3.6.9.

Modifying row 73 let’s the script start but then new errors are appearing:

/home/debian/.local/lib/python3.5/site-packages/openmc/data/energy\_distribution.py:1246: UserWarning: Interpolation scheme for continuous tabular distribution is not histogram or linear-linear.  
warn("Interpolation scheme for continuous tabular distribution "  
Converting 1001.710nc (ACE) to H1 (HDF5)  
Converting 1001.711nc (ACE) to H1 (HDF5)  
/home/debian/.local/lib/python3.5/site-packages/openmc/data/neutron.py:284: UserWarning: Tried to add cross sections for MT=1 at T=600K but this reaction doesn’t exist.  
“reaction doesn’t exist.”.format(mt, strT))  
/home/debian/.local/lib/python3.5/site-packages/openmc/data/neutron.py:284: UserWarning: Tried to add cross sections for MT=101 at T=600K but this reaction doesn’t exist.  
“reaction doesn’t exist.”.format(mt, strT))  
Traceback (most recent call last):  
File “/usr/local/bin/openmc-ace-to-hdf5”, line 126, in   
data.export\_to\_hdf5(converted[name] + ‘\_1’, ‘w’, libver=args.libver)  
TypeError: unsupported operand type(s) for +: ‘PosixPath’ and ‘str’

This is now less important as I was able to convert the cross section on the machine with python 3.6.9. Nevertheless, the warnings related to not existing reactions where appearing also there.

/home/debian/.local/lib/python3.5/site-packages/openmc/data/neutron.py:284: UserWarning: Tried to add cross sections for MT=1 at T=600K but this reaction doesn’t exist.  
“reaction doesn’t exist.”.format(mt, strT))  
/home/debian/.local/lib/python3.5/site-packages/openmc/data/neutron.py:284: UserWarning: Tried to add cross sections for MT=101 at T=600K but this reaction doesn’t exist.  
“reaction doesn’t exist.”.format(mt, strT))

Is it something to be worried?

Thanks again

Valerio

---

<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:** [March 3, 2021, 12:28am UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040/4 "2021-03-03T00:28:27Z")

</div>

No, in this case, I wouldn’t be worried about the messages about these missing reactions. MT=1 and MT=101 correspond to the total cross section and the total neutron disappearance cross section, respectively. Both of those are redundant reactions that are recalculated as needed anyway.

---

<div class="post-metadata">

**Author:** ![valerio69](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/valerio69/32/1192_2.png) [@valerio69](https://openmc.discourse.group/u/valerio69)\
**Post date:** [March 3, 2021, 6:17am UTC](https://openmc.discourse.group/t/openmc-ace-to-hdf5-error/1040/5 "2021-03-03T06:17:17Z")

</div>

Thanks a lot.

Valerio
