Skip to content

Commit

Permalink
properly handle internal tallies
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Aug 29, 2023
1 parent dce99d9 commit 1838375
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions openmc/statepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,21 @@ def tallies(self):

# Iterate over all tallies
for tally_id in tally_ids:
tally = openmc.Tally(tally_id)
self._populate_tally(tally)
self._tallies[tally_id] = tally
tally = self._read_tally(tally_id)
if tally is not None:
self._tallies[tally_id] = tally

self._tallies_read = True

return self._tallies

def _read_tally(self, tally_id):
if self._f['tallies'][f'tally {tally_id}'].attrs.get('internal'):
return
tally = openmc.Tally(tally_id)
self._populate_tally(tally)
return tally

def _populate_tally(self, tally):
group = self._f['tallies'][f'tally {tally.id}']

Expand Down

0 comments on commit 1838375

Please sign in to comment.