Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove special handling of 'total' score
  • Loading branch information
paulromano committed Feb 15, 2024
commit e4b41a58d58e7bda3d679543a4d0607f6a7fa223
18 changes: 2 additions & 16 deletions openmc_plotter/docks.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,9 @@ def selectTally(self, tally_label=None):
self.score_map = {}
self.scoresListWidget.clear()

sorted_scores = sorted(tally.scores)
# always put total first if present
if 'total' in sorted_scores:
idx = sorted_scores.index('total')
sorted_scores.insert(0, sorted_scores.pop(idx))

for score in sorted_scores:
for score in tally.scores:
ql = QListWidgetItem()
ql.setText(score.capitalize())
ql.setText(score)
ql.setCheckState(QtCore.Qt.Unchecked)
if not spatial_filters:
ql.setFlags(QtCore.Qt.ItemIsUserCheckable)
Expand Down Expand Up @@ -635,14 +629,6 @@ def updateScores(self):
score_box.setFlags(QtCore.Qt.ItemIsUserCheckable |
QtCore.Qt.ItemIsEnabled |
QtCore.Qt.ItemIsSelectable)
elif 'total' in applied_scores:
self.model.appliedScores = ('total',)
# if total is selected, disable all other scores
for score, score_box in self.score_map.items():
if score != 'total':
score_box.setFlags(QtCore.Qt.ItemIsUserCheckable)
score_box.setToolTip(
"De-select 'total' to enable other scores")
else:
# get units of applied scores
selected_units = _SCORE_UNITS.get(
Expand Down