Determine Tally.sum, sum_sq, mean, std_dev on demand. No more read_results()!

This commit is contained in:
Paul Romano 2015-09-16 16:19:12 +07:00
parent aac5eb6f52
commit 97a7582c44
8 changed files with 67 additions and 95 deletions

View file

@ -14,17 +14,16 @@ class FixedSourceTestHarness(TestHarness):
# Read the statepoint file.
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = StatePoint(statepoint)
sp.read_results()
# Write out tally data.
outstr = ''
if self._tallies:
tally_num = 1
for tally_ind in sp._tallies:
tally = sp._tallies[tally_ind]
results = np.zeros((tally._sum.size*2, ))
results[0::2] = tally._sum.ravel()
results[1::2] = tally._sum_sq.ravel()
for tally_ind in sp.tallies:
tally = sp.tallies[tally_ind]
results = np.zeros((tally.sum.size*2, ))
results[0::2] = tally.sum.ravel()
results[1::2] = tally.sum_sq.ravel()
results = ['{0:12.6E}'.format(x) for x in results]
outstr += 'tally ' + str(tally_num) + ':\n'