mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Changes in statepoint.py from PullRequest Inc. review
This commit is contained in:
parent
d58f8a2da2
commit
ffd78be628
1 changed files with 6 additions and 26 deletions
|
|
@ -416,14 +416,10 @@ class StatePoint:
|
|||
nuclide = openmc.Nuclide(name.decode().strip())
|
||||
tally.nuclides.append(nuclide)
|
||||
|
||||
scores = group['score_bins'][()]
|
||||
n_score_bins = group['n_score_bins'][()]
|
||||
|
||||
# Add the scores to the Tally
|
||||
for j, score in enumerate(scores):
|
||||
score = score.decode()
|
||||
|
||||
tally.scores.append(score)
|
||||
scores = group['score_bins'][()]
|
||||
for score in scores:
|
||||
tally.scores.append(score.decode())
|
||||
|
||||
# Add Tally to the global dictionary of all Tallies
|
||||
tally.sparse = self.sparse
|
||||
|
|
@ -586,15 +582,7 @@ class StatePoint:
|
|||
|
||||
# Determine if Tally has the queried score(s)
|
||||
if scores:
|
||||
contains_scores = True
|
||||
|
||||
# Iterate over the scores requested by the user
|
||||
for score in scores:
|
||||
if score not in test_tally.scores:
|
||||
contains_scores = False
|
||||
break
|
||||
|
||||
if not contains_scores:
|
||||
if not all(score in test_tally.scores for score in scores):
|
||||
continue
|
||||
|
||||
# Determine if Tally has the queried Filter(s)
|
||||
|
|
@ -620,15 +608,7 @@ class StatePoint:
|
|||
|
||||
# Determine if Tally has the queried Nuclide(s)
|
||||
if nuclides:
|
||||
contains_nuclides = True
|
||||
|
||||
# Iterate over the Nuclides requested by the user
|
||||
for nuclide in nuclides:
|
||||
if nuclide not in test_tally.nuclides:
|
||||
contains_nuclides = False
|
||||
break
|
||||
|
||||
if not contains_nuclides:
|
||||
if not all(nuclide in test_tally.nuclides for nuclide in nuclides):
|
||||
continue
|
||||
|
||||
# If the current Tally met user's request, break loop and return it
|
||||
|
|
@ -676,7 +656,7 @@ class StatePoint:
|
|||
|
||||
cells = summary.geometry.get_all_cells()
|
||||
|
||||
for tally_id, tally in self.tallies.items():
|
||||
for tally in self.tallies.values():
|
||||
tally.with_summary = True
|
||||
|
||||
for tally_filter in tally.filters:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue