Teach openmc.StatePoint about internal tallies

When reading tally data from the statepoint file,
tallies that are marked as internal are not created nor added
to the StatePoint.tallies property
This commit is contained in:
Andrew Johnson 2019-09-20 10:31:56 -05:00
parent a83f4d2bb2
commit 4b688e5efa
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB

View file

@ -375,13 +375,18 @@ class StatePoint(object):
for tally_id in tally_ids:
group = tallies_group['tally {}'.format(tally_id)]
# Read the number of realizations
n_realizations = group['n_realizations'][()]
# Check if tally is internal and therefore has no data
if group.attrs.get("internal"):
continue
# Create Tally object and assign basic properties
tally = openmc.Tally(tally_id)
tally._sp_filename = self._f.filename
tally.name = group['name'][()].decode() if 'name' in group else ''
# Read the number of realizations
n_realizations = group['n_realizations'][()]
tally.estimator = group['estimator'][()].decode()
tally.num_realizations = n_realizations