Skip to content

Commit 3ac5d6f

Browse files
shimwellpaulromano
andauthored
Allow Path objects in MGXSLibrary.export_to_hdf5 (#3608)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
1 parent 055ea15 commit 3ac5d6f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

openmc/mgxs_library.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import openmc.mgxs
1212
from openmc.mgxs import SCATTER_TABULAR, SCATTER_LEGENDRE, SCATTER_HISTOGRAM
1313
from .checkvalue import check_type, check_value, check_greater_than, \
14-
check_iterable_type, check_less_than, check_filetype_version
14+
check_iterable_type, check_less_than, check_filetype_version, PathLike
1515

1616
ROOM_TEMPERATURE_KELVIN = 294.0
1717

@@ -2506,15 +2506,15 @@ def export_to_hdf5(self, filename='mgxs.h5', libver='earliest'):
25062506
25072507
Parameters
25082508
----------
2509-
filename : str
2509+
filename : str or PathLike
25102510
Filename of file, default is mgxs.h5.
25112511
libver : {'earliest', 'latest'}
25122512
Compatibility mode for the HDF5 file. 'latest' will produce files
25132513
that are less backwards compatible but have performance benefits.
25142514
25152515
"""
25162516

2517-
check_type('filename', filename, str)
2517+
check_type('filename', filename, PathLike)
25182518

25192519
# Create and write to the HDF5 file
25202520
file = h5py.File(filename, "w", libver=libver)

0 commit comments

Comments
 (0)