Skip to content

Commit 0d19866

Browse files
authored
Merge pull request #3676 from thocevar/testscore
[FIX] Test & Score: hide warnings for hidden scores.
2 parents 1a9c4b5 + bd1f212 commit 0d19866

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Orange/widgets/evaluate/owtestlearners.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ def _update_shown_columns(self):
525525
for section in range(1, model.columnCount()):
526526
col_name = model.horizontalHeaderItem(section).data(Qt.DisplayRole)
527527
header.setSectionHidden(section, col_name not in self.shown_scores)
528+
self.view.resizeColumnsToContents()
529+
self._update_stats_model() # updates warnings for displayed columns
528530

529531
def _update_stats_model(self):
530532
# Update the results_model with up to date scores.
@@ -583,13 +585,14 @@ def _update_stats_model(self):
583585
stats = slot.stats
584586

585587
if stats is not None:
586-
for stat in stats:
588+
for stat, scorer in zip(stats, self.scorers):
587589
item = QStandardItem()
588590
if stat.success:
589591
item.setText("{:.3f}".format(stat.value[0]))
590592
else:
591593
item.setToolTip(str(stat.exception))
592-
has_missing_scores = True
594+
if scorer.name in self.shown_scores:
595+
has_missing_scores = True
593596
row.append(item)
594597

595598
model.appendRow(row)

0 commit comments

Comments
 (0)