TestHarness adjustments for #402

This commit is contained in:
Sterling Harper 2015-06-28 00:06:33 -06:00
parent e05c1e4074
commit f13351f2ee
25 changed files with 201 additions and 210907 deletions

View file

@ -14,27 +14,23 @@ class SourcepointTestHarness(TestHarness):
or statepoint[0].endswith('h5'), \
'Statepoint file is not a binary or hdf5 file.'
def _get_results(self):
"""Digest info in the statepoint and create a simpler ASCII file."""
"""Digest info in the statepoint and return as a string."""
# Read the statepoint file.
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = StatePoint(statepoint)
sp.read_results()
sp.read_source()
# Write out k-combined.
outstr = 'k-combined:\n'
form = '{0:12.6E} {1:12.6E}\n'
outstr += form.format(sp.k_combined[0], sp.k_combined[1])
# Get the eigenvalue information.
outstr = TestHarness._get_results(self)
# Add the source information.
xyz = sp._source[0]._xyz
outstr += ' '.join(['{0:12.6E}'.format(x) for x in xyz])
outstr += "\n"
# Write results to a file.
with open('results_test.dat','w') as fh:
fh.write(outstr)
return outstr
if __name__ == '__main__':