mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Fixed array range in the python score setter and updated example to match
This commit is contained in:
parent
199126b2fc
commit
ecbb5e668a
2 changed files with 351 additions and 515 deletions
File diff suppressed because one or more lines are too long
|
|
@ -376,7 +376,7 @@ class Tally(IDManagerMixin):
|
|||
def scores(self, scores):
|
||||
cv.check_type('tally scores', scores, MutableSequence)
|
||||
|
||||
for i, score in enumerate(scores[:-1]):
|
||||
for i, score in enumerate(scores):
|
||||
# If the score is already in the Tally, raise an error
|
||||
if score in scores[i+1:]:
|
||||
msg = 'Unable to add a duplicate score "{0}" to Tally ID="{1}" ' \
|
||||
|
|
@ -390,7 +390,7 @@ class Tally(IDManagerMixin):
|
|||
for deprecated in ['scatter-', 'nu-scatter-', 'scatter-p',
|
||||
'nu-scatter-p', 'scatter-y', 'nu-scatter-y',
|
||||
'flux-y', 'total-y']:
|
||||
if score.startswith(deprecated):
|
||||
if score.strip().startswith(deprecated):
|
||||
msg = score.strip() + ' is no longer supported.'
|
||||
raise ValueError(msg)
|
||||
scores[i] = score.strip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue