diff --git a/armi/nuclearDataIO/cccc/isotxs.py b/armi/nuclearDataIO/cccc/isotxs.py index 4005fc0f5..69c7747a7 100644 --- a/armi/nuclearDataIO/cccc/isotxs.py +++ b/armi/nuclearDataIO/cccc/isotxs.py @@ -123,13 +123,14 @@ def compare(lib1, lib2, tolerance=0.0, verbose=False): runLog.warning(warning.format(nuc2, 2, 1)) equal = False continue - equal &= compareNuclideXS(nuc1, nuc2, tolerance, verbose) + nucEqual = compareNuclideXS(nuc1, nuc2, tolerance, verbose, nucName) + equal &= nucEqual return equal -def compareNuclideXS(nuc1, nuc2, tolerance=0.0, verbose=False): +def compareNuclideXS(nuc1, nuc2, tolerance=0.0, verbose=False, nucName=""): equal = nuc1.isotxsMetadata.compare(nuc2.isotxsMetadata, nuc1, nuc2) - equal &= nuc1.micros.compare(nuc2.micros, [], tolerance, verbose) + equal &= nuc1.micros.compare(nuc2.micros, [], tolerance, verbose, nucName=nucName) return equal diff --git a/armi/nuclearDataIO/xsCollections.py b/armi/nuclearDataIO/xsCollections.py index 91914fcf9..913032aef 100644 --- a/armi/nuclearDataIO/xsCollections.py +++ b/armi/nuclearDataIO/xsCollections.py @@ -271,8 +271,9 @@ def collapseCrossSection(crossSection, weights): mult = np.array(crossSection) * np.array(weights) return sum(mult) / sum(weights) - def compare(self, other, flux, relativeTolerance=0, verbose=False): + def compare(self, other, flux, relativeTolerance=0, verbose=False, nucName=""): """Compare the cross sections between two XSCollections objects.""" + nuclideIDMsg = f"Nuclide {nucName} " if nucName else "" equal = True for xsName in ALL_COLLECTION_DATA: myXsData = self.__dict__[xsName] @@ -283,8 +284,10 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False): if actualList != expectedList: equal = False runLog.important( - " {} {:<30} cross section is different.".format( - self.source, xsName + " {}{} {:<30} cross section is different.".format( + nuclideIDMsg, + self.source, + xsName, ) ) @@ -301,8 +304,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False): else "\n{},\n\n{}".format(myXsData, theirXsData) ) runLog.important( - " {} {:<30} cross section is different.{}".format( - self.source, xsName, verboseData + " {}{} {:<30} cross section is different.{}".format( + nuclideIDMsg, self.source, xsName, verboseData ) ) equal = False @@ -314,8 +317,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False): "" if not verbose else "\n{},\n\n{}".format(myXsData, theirXsData) ) runLog.important( - " {} {:<30} cross section is different.{}".format( - self.source, xsName, verboseData + " {}{} {:<30} cross section is different.{}".format( + nuclideIDMsg, self.source, xsName, verboseData ) ) equal = False