Ejemplo n.º 1
0
def compare(lib1, lib2):
    """Compare two XSLibraries, and return True if equal, or False if not."""
    # pylint: disable=import-outside-toplevel) ; avoid cyclic import with isotxs bringing this in for data structure
    from armi.nuclearDataIO.cccc import isotxs
    from armi.nuclearDataIO.cccc import gamiso
    from armi.nuclearDataIO.cccc import pmatrx

    equal = True
    # check the nuclides
    equal &= _checkLabels(lib1, lib2)
    equal &= _checkLabels(lib2, lib1)
    equal &= isotxs.compare(lib1, lib2)
    equal &= gamiso.compare(lib1, lib2)
    equal &= pmatrx.compare(lib1, lib2)
    return equal
Ejemplo n.º 2
0
 def test_mergeXSLibrariesWithDifferentDataWorks(self):
     if self.xsLibGenerationErrorStack is not None:
         print(self.xsLibGenerationErrorStack)
         raise Exception("see stdout for stack trace")
     # check to make sure they labels overlap... or are actually the same
     labels = set(self.xsLib.nuclideLabels)
     self.assertEqual(labels, set(self.isotxsAA.nuclideLabels))
     self.assertEqual(labels, set(self.gamisoAA.nuclideLabels))
     self.assertEqual(labels, set(self.pmatrxAA.nuclideLabels))
     # the whole thing is different from the sum of its components
     self.assertFalse(xsLibraries.compare(self.xsLib, self.isotxsAA))
     self.assertFalse(xsLibraries.compare(self.xsLib, self.gamisoAA))
     self.assertFalse(xsLibraries.compare(self.xsLib, self.pmatrxAA))
     # individual components are the same
     self.assertTrue(isotxs.compare(self.xsLib, self.isotxsAA))
     self.assertTrue(gamiso.compare(self.xsLib, self.gamisoAA))
     self.assertTrue(pmatrx.compare(self.xsLib, self.pmatrxAA))