Skip to content

Commit

Permalink
Remove special handling of 'total' score
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Feb 15, 2024
1 parent e5660ee commit e4b41a5
Showing 1 changed file with 2 additions and 16 deletions.
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

0 comments on commit e4b41a5

Please sign in to comment.