예제 #1
0
 def test_readAbundance(self):
     inp = six.StringIO(SAMPLE_RIPL_ABUNDANCE)
     for z, a, sym, percent, _err in ripl.readAbundanceFile(inp):
         if z == 2 and a == 4:
             self.assertAlmostEqual(percent, 99.999863)
             self.assertEqual(sym, "HE")
             break
     else:
         raise ValueError("No helium found")
예제 #2
0
def __readRiplAbundance():
    """
    Read natural abundances of any natural nuclides.

    This adjusts already-existing NuclideBases and Elements with the new information.
    """
    from armi.nuclearDataIO import ripl

    with open(os.path.join(armi.context.RES, "ripl-abundance.dat")) as ripl_abundance:
        for _z, a, sym, percent, _err in ripl.readAbundanceFile(ripl_abundance):
            nb = byName[sym + "{}".format(a)]
            nb.abundance = percent / 100.0