Skip to content

Commit

Permalink
owexplainpredictions - use deferred commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Jul 26, 2023
1 parent 20b2c75 commit 8281dc2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions orangecontrib/explain/widgets/owexplainpredictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def _add_plot(self):

def __on_selection_changed(self, selection: List[Tuple[float, float]]):
self.selection_ranges = selection
self.commit()
self.commit.deferred()

def _add_controls(self):
box = gui.vBox(self.controlArea, "Target class")
Expand Down Expand Up @@ -624,12 +624,12 @@ def _add_controls(self):
def __on_target_changed(self):
self.selection_ranges = []
self.setup_plot()
self.commit()
self.commit.deferred()

def __on_order_changed(self):
self.selection_ranges = []
self.setup_plot()
self.commit()
self.commit.deferred()

def __on_annot_changed(self):
if not self.__results or not self.data:
Expand Down Expand Up @@ -717,7 +717,7 @@ def _setup_controls(self):
def handleNewSignals(self):
self.clear()
self.start(run, self.data, self.background_data, self.model)
self.commit()
self.commit.deferred()

def clear(self):
self.__results = None
Expand Down Expand Up @@ -815,6 +815,7 @@ def apply_selection(self):
self.__on_selection_changed(selection_ranges)
self.__pending_selection = []

@gui.deferred
def commit(self):
selected = None
selected_indices = []
Expand Down

0 comments on commit 8281dc2

Please sign in to comment.