@@ -271,8 +271,9 @@ def collapseCrossSection(crossSection, weights):
271271 mult = np .array (crossSection ) * np .array (weights )
272272 return sum (mult ) / sum (weights )
273273
274- def compare (self , other , flux , relativeTolerance = 0 , verbose = False ):
274+ def compare (self , other , flux , relativeTolerance = 0 , verbose = False , nucName = "" ):
275275 """Compare the cross sections between two XSCollections objects."""
276+ nuclideIDMsg = f"Nuclide { nucName } " if nucName else ""
276277 equal = True
277278 for xsName in ALL_COLLECTION_DATA :
278279 myXsData = self .__dict__ [xsName ]
@@ -283,8 +284,10 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
283284 if actualList != expectedList :
284285 equal = False
285286 runLog .important (
286- " {} {:<30} cross section is different." .format (
287- self .source , xsName
287+ " {}{} {:<30} cross section is different." .format (
288+ nuclideIDMsg ,
289+ self .source ,
290+ xsName ,
288291 )
289292 )
290293
@@ -301,8 +304,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
301304 else "\n {},\n \n {}" .format (myXsData , theirXsData )
302305 )
303306 runLog .important (
304- " {} {:<30} cross section is different.{}" .format (
305- self .source , xsName , verboseData
307+ " {}{} {:<30} cross section is different.{}" .format (
308+ nuclideIDMsg , self .source , xsName , verboseData
306309 )
307310 )
308311 equal = False
@@ -314,8 +317,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
314317 "" if not verbose else "\n {},\n \n {}" .format (myXsData , theirXsData )
315318 )
316319 runLog .important (
317- " {} {:<30} cross section is different.{}" .format (
318- self .source , xsName , verboseData
320+ " {}{} {:<30} cross section is different.{}" .format (
321+ nuclideIDMsg , self .source , xsName , verboseData
319322 )
320323 )
321324 equal = False
0 commit comments