Skip to content

Commit

Permalink
Test and Score: More minor changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Jan 24, 2020
1 parent e1fad41 commit 4051e02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Orange/widgets/evaluate/owtestlearners.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def __init__(self):
gui.lineEdit(hbox, self, "rope", validator=QDoubleValidator(),
controlWidth=70, callback=self.update_comparison_table,
alignment=Qt.AlignRight)
self.controls.rope.setEnabled(self.use_rope)

gui.rubber(self.controlArea)
self.score_table = ScoreTable(self)
Expand Down Expand Up @@ -641,6 +642,8 @@ def _on_use_rope_changed(self):
def update_comparison_table(self):
self.comparison_table.clearContents()
slots = self._successful_slots()
if not (slots and self.scorers):
return
names = [learner_name(slot.learner) for slot in slots]
self._set_comparison_headers(names)
if self.resampling == OWTestLearners.KFold:
Expand All @@ -662,15 +665,15 @@ def _set_comparison_headers(self, names):
try:
# Prevent glitching during update
table.setUpdatesEnabled(False)
table.setRowCount(len(names))
table.setColumnCount(len(names))
table.setVerticalHeaderLabels(names)
table.setHorizontalHeaderLabels(names)
header = table.horizontalHeader()
if len(names) > 2:
header.setSectionResizeMode(QHeaderView.Stretch)
else:
header.setSectionResizeMode(QHeaderView.Fixed)
table.setRowCount(len(names))
table.setColumnCount(len(names))
table.setVerticalHeaderLabels(names)
table.setHorizontalHeaderLabels(names)
finally:
table.setUpdatesEnabled(True)

Expand Down

0 comments on commit 4051e02

Please sign in to comment.