Skip to content

Commit

Permalink
owtestlearners: Let _invalidate handle task canceling
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Nov 19, 2019
1 parent 73187d0 commit 7578238
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Orange/widgets/evaluate/owtestlearners.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ def set_learner(self, learner, key):
learner : Optional[Orange.base.Learner]
key : Any
"""
self.cancel()
if key in self.learners and learner is None:
# Removed
self._invalidate([key])
Expand Down Expand Up @@ -392,7 +391,6 @@ def set_test_data(self, data):
----------
data : Optional[Orange.data.Table]
"""
self.cancel()
self.Information.test_data_sampled.clear()
self.Error.test_data_empty.clear()
if data is not None and not data:
Expand Down Expand Up @@ -448,13 +446,11 @@ def set_preprocessor(self, preproc):
"""
Set the input preprocessor to apply on the training data.
"""
self.cancel()
self.preprocessor = preproc
self._invalidate()

def handleNewSignals(self):
"""Reimplemented from OWWidget.handleNewSignals."""
self.cancel()
self._update_class_selection()
self.score_table.update_header(self.scorers)
self.update_stats_model()
Expand Down Expand Up @@ -591,6 +587,7 @@ def _on_target_class_changed(self):
self.update_stats_model()

def _invalidate(self, which=None):
self.cancel()
self.fold_feature_selected = \
self.resampling == OWTestLearners.FeatureFold
# Invalidate learner results for `which` input keys
Expand Down

0 comments on commit 7578238

Please sign in to comment.