Пример #1
0
 def _test_output_created(self):
     """Make sure statepoint files have been created."""
     sps = ('statepoint.02.*', 'statepoint.04.*', 'statepoint.06.*',
            'statepoint.08.*', 'statepoint.10.*')
     for sp in sps:
         self._sp_name = sp
         TestHarness._test_output_created(self)
Пример #2
0
 def _cleanup(self):
     TestHarness._cleanup(self)
     output = glob.glob(os.path.join(os.getcwd(), 'summary.*'))
     output.append(os.path.join(os.getcwd(), 'cross_sections.out'))
     for f in output:
         if os.path.exists(f):
             os.remove(f)
Пример #3
0
 def _cleanup(self):
     TestHarness._cleanup(self)
     output = glob.glob(os.path.join(os.getcwd(), 'track*'))
     output += glob.glob(os.path.join(os.getcwd(), 'poly*'))
     for f in output:
         if os.path.exists(f):
             os.remove(f)
Пример #4
0
 def _test_output_created(self):
     """Make sure statepoint.* and source* have been created."""
     TestHarness._test_output_created(self)
     source = glob.glob(os.path.join(os.getcwd(), 'source.*'))
     assert len(source) == 1, 'Either multiple or no source files ' \
          'exist.'
     assert source[0].endswith('h5'), \
          'Source file is not a HDF5 file.'
Пример #5
0
    def _test_output_created(self):
        """Make sure output files have been created."""
        # Check for the statepoint.
        TestHarness._test_output_created(self)

        # Check for the summary.
        summary = glob.glob(os.path.join(os.getcwd(), 'summary.*'))
        assert len(summary) == 1, 'Either multiple or no summary file exists.'
        assert summary[0].endswith('h5'),\
            'Summary file is not a HDF5 file.'
Пример #6
0
    def _test_output_created(self):
        """Make sure statepoint.* and track* have been created."""
        TestHarness._test_output_created(self)

        outputs = [glob.glob(''.join((os.getcwd(), '/track_1_1_1.*')))]
        outputs.append(glob.glob(''.join((os.getcwd(), '/track_1_1_2.*'))))
        for files in outputs:
            assert len(files) == 1, 'Multiple or no track files detected.'
            assert files[0].endswith('h5'),\
                'Track files are not HDF5 files'
    def _get_results(self):
        """Digest info in the statepoint and return as a string."""
        # Get the eigenvalue information.
        outstr = TestHarness._get_results(self)

        # Read the statepoint file.
        statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
        with StatePoint(statepoint) as sp:
            # Add the source information.
            xyz = sp.source[0]['xyz']
            outstr += ' '.join(['{0:12.6E}'.format(x) for x in xyz])
            outstr += "\n"

        return outstr
Пример #8
0
#!/usr/bin/env python

import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import TestHarness


class SourcepointTestHarness(TestHarness):
    def _test_output_created(self):
        """Make sure statepoint.* and source* have been created."""
        TestHarness._test_output_created(self)
        source = glob.glob(os.path.join(os.getcwd(), 'source.*'))
        assert len(source) == 1, 'Either multiple or no source files ' \
             'exist.'
        assert source[0].endswith('h5'), \
             'Source file is not a HDF5 file.'


if __name__ == '__main__':
    harness = TestHarness('statepoint.10.*')
    harness.main()
Пример #9
0
#!/usr/bin/env python

import os
import sys

sys.path.insert(0, os.pardir)
from testing_harness import TestHarness

if __name__ == '__main__':
    harness = TestHarness('statepoint.15.h5')
    harness.main()
Пример #10
0
 def _cleanup(self):
     TestHarness._cleanup(self)
     output = glob.glob(os.path.join(os.getcwd(), 'source.*'))
     for f in output:
         if os.path.exists(f):
             os.remove(f)
Пример #11
0
#!/usr/bin/env python

import os
import sys

sys.path.insert(0, os.pardir)
from testing_harness import TestHarness

if __name__ == '__main__':
    harness = TestHarness('statepoint.20.*', True)
    harness.main()
Пример #12
0
 def _cleanup(self):
     TestHarness._cleanup(self)
     output = glob.glob('track*') + glob.glob('poly*')
     for f in output:
         if os.path.exists(f):
             os.remove(f)
Пример #13
0
    def _test_output_created(self):
        """Make sure statepoint.* and track* have been created."""
        TestHarness._test_output_created(self)

        outputs = glob.glob('track_1_1_*.h5')
        assert len(outputs) == 2, 'Expected two track files.'