mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #1091 from janmalec/local-develop
Fixed array range in the python score setter and updated example to m…
This commit is contained in:
commit
28d4667755
3 changed files with 352 additions and 516 deletions
File diff suppressed because one or more lines are too long
|
|
@ -2774,7 +2774,7 @@ class TransportXS(MGXS):
|
|||
p1_tally = p1_tally.get_slice(filters=[openmc.LegendreFilter],
|
||||
filter_bins=[('P1',)],
|
||||
squeeze=True)
|
||||
p1_tally.scores = ['scatter-1']
|
||||
p1_tally._scores = ['scatter-1']
|
||||
|
||||
# Compute total cross section
|
||||
total_xs = self.tallies['total'] / self.tallies['flux (tracklength)']
|
||||
|
|
|
|||
|
|
@ -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