def test_cross_sections_read(): sample_xs.seek(0) xs = openmc_utils.CrossSections(sample_xs) assert_equal('ascii', xs.filetype) assert_true(xs.path is None) exp = [ openmc_utils.AceTable(alias='H-1.71c', awr='0.999167', location='1', name='1001.71c', path='293.6K/H_001_293.6K.ace', temperature='2.53e-08', zaid='1001'), openmc_utils.AceTable(alias='Am-242m.73c', awr='239.9801', location='1', metastable='1', name='95242.73c', path='900K/Am_242_900K.ace', temperature='7.756e-08', zaid='95242'), openmc_utils.AceTable(awr='89.1324', location='1', name='ZrZrH.71t', path='tsl/zrzrh.acer', temperature='2.551e-08', zaid='0') ] assert_equal(exp, xs.ace_tables)
def test_ace_table_xml(): atab = openmc_utils.AceTable(zaid='92235', path='U235.ace', cross_sections_path='/tmp/cross_sections.xml') exp = '<ace_table path="U235.ace" zaid="92235"/>' obs = atab.xml() assert_equal(exp, obs)
def test_ace_table_init(): atab = openmc_utils.AceTable(zaid='92235', path='U235.ace', cross_sections_path='/tmp/cross_sections.xml') assert_equal('92235', atab.zaid) assert_equal('U235.ace', atab.path) assert_equal('/tmp/U235.ace', atab.abspath) assert_equal(nucname.id('U235'), atab.nucid)
def test_ace_table_init(): atab = openmc_utils.AceTable(zaid="92235", path="U235.ace", cross_sections_path="/tmp/cross_sections.xml") assert_equal("92235", atab.zaid) assert_equal("U235.ace", atab.path) assert_equal("/tmp/U235.ace", atab.abspath) assert_equal(nucname.id("U235"), atab.nucid)
def test_cross_sections_read(): sample_xs.seek(0) xs = openmc_utils.CrossSections(sample_xs) assert_equal("ascii", xs.filetype) assert_true(xs.path is None) exp = [ openmc_utils.AceTable( alias="H-1.71c", awr="0.999167", location="1", name="1001.71c", path="293.6K/H_001_293.6K.ace", temperature="2.53e-08", zaid="1001", ), openmc_utils.AceTable( alias="Am-242m.73c", awr="239.9801", location="1", metastable="1", name="95242.73c", path="900K/Am_242_900K.ace", temperature="7.756e-08", zaid="95242", ), openmc_utils.AceTable( awr="89.1324", location="1", name="ZrZrH.71t", path="tsl/zrzrh.acer", temperature="2.551e-08", zaid="0", ), ] assert_equal(exp, xs.ace_tables)