@@ -271,8 +271,9 @@ def collapseCrossSection(crossSection, weights):
271
271
mult = np .array (crossSection ) * np .array (weights )
272
272
return sum (mult ) / sum (weights )
273
273
274
- def compare (self , other , flux , relativeTolerance = 0 , verbose = False ):
274
+ def compare (self , other , flux , relativeTolerance = 0 , verbose = False , nucName = "" ):
275
275
"""Compare the cross sections between two XSCollections objects."""
276
+ nuclideIDMsg = f"Nuclide { nucName } " if nucName else ""
276
277
equal = True
277
278
for xsName in ALL_COLLECTION_DATA :
278
279
myXsData = self .__dict__ [xsName ]
@@ -283,8 +284,10 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
283
284
if actualList != expectedList :
284
285
equal = False
285
286
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 ,
288
291
)
289
292
)
290
293
@@ -301,8 +304,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
301
304
else "\n {},\n \n {}" .format (myXsData , theirXsData )
302
305
)
303
306
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
306
309
)
307
310
)
308
311
equal = False
@@ -314,8 +317,8 @@ def compare(self, other, flux, relativeTolerance=0, verbose=False):
314
317
"" if not verbose else "\n {},\n \n {}" .format (myXsData , theirXsData )
315
318
)
316
319
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
319
322
)
320
323
)
321
324
equal = False
0 commit comments