diff --git a/openmc/summary.py b/openmc/summary.py index 41bae7f26b..43224334d0 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -14,6 +14,11 @@ _VERSION_SUMMARY = 6 class Summary: """Summary of model used in a simulation. + Parameters + ---------- + filename : str or path-like + Path to file to load + Attributes ---------- date_and_time : str @@ -33,8 +38,9 @@ class Summary: """ def __init__(self, filename): + filename = str(filename) if not filename.endswith(('.h5', '.hdf5')): - msg = 'Unable to open "{0}" which is not an HDF5 summary file' + msg = f'Unable to open "{filename}" which is not an HDF5 summary file' raise ValueError(msg) self._f = h5py.File(filename, 'r')