mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Fix check when opening statepoint and fix documentation. Closes #464.
This commit is contained in:
parent
9ab91e7df7
commit
c2a53495cb
2 changed files with 9 additions and 4 deletions
|
|
@ -4,7 +4,7 @@
|
|||
State Point File Format
|
||||
=======================
|
||||
|
||||
The current revision of the statepoint file format is 13.
|
||||
The current revision of the statepoint file format is 14.
|
||||
|
||||
**/filetype** (*char[]*)
|
||||
|
||||
|
|
|
|||
|
|
@ -92,9 +92,14 @@ class StatePoint(object):
|
|||
self._f = h5py.File(filename, 'r')
|
||||
|
||||
# Ensure filetype and revision are correct
|
||||
if 'filetype' not in self._f or self._f[
|
||||
'filetype'].value.decode() != 'statepoint':
|
||||
raise IOError('{} is not a statepoint file.'.format(filename))
|
||||
try:
|
||||
if 'filetype' not in self._f or self._f[
|
||||
'filetype'].value.decode() != 'statepoint':
|
||||
raise IOError('{} is not a statepoint file.'.format(filename))
|
||||
except AttributeError:
|
||||
raise IOError('Could not read statepoint file. This most likely '
|
||||
'means the statepoint file was produced by a different '
|
||||
'version of OpenMC than the one you are using.')
|
||||
if self._f['revision'].value != 14:
|
||||
raise IOError('Statepoint file has a file revision of {} '
|
||||
'which is not consistent with the revision this '
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue