From 8c3789cb788bd2f5070e1fdb46a5272260c61ec7 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Fri, 28 Nov 2014 12:28:43 -0500 Subject: [PATCH] Fixed bug in replacing score strings for scatter-*n in statepoint.py --- src/utils/openmc/statepoint.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/openmc/statepoint.py b/src/utils/openmc/statepoint.py index 627a09c0b5..370df0eec6 100644 --- a/src/utils/openmc/statepoint.py +++ b/src/utils/openmc/statepoint.py @@ -380,8 +380,12 @@ class StatePoint(object): for j, score in enumerate(scores): # If this is a scattering moment, insert the scattering order - if 'scatter-n' in score or 'scatter-yn' in score or 'scatter-pn' in score: - score = score.replace('n', str(scatt_order[j])) + if '-n' in score: + score = score.replace('-n', '-' + str(scatt_order[j])) + elif '-yn' in score: + score = score.replace('-pn', '-p' + str(scatt_order[j])) + elif '-pn' in score: + score = score.replace('-yn', '-y' + str(scatt_order[j])) tally.add_score(score)