Skip to content

Commit

Permalink
Topic Modelling - Do not recompute when spin value doesn't change
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Nov 3, 2023
1 parent 3ebeaea commit c82b4b4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions orangecontrib/text/widgets/owtopicmodeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ def __init__(self, master, **kwargs):
self.model = self.create_model()
QVBoxLayout(self)
for parameter, description, minv, maxv, step, _type in self.parameters:
spin = gui.spin(self, self, parameter, minv=minv, maxv=maxv, step=step,
label=self.spin_format.format(description=description, parameter=parameter),
labelWidth=220, spinType=_type)
spin = gui.spin(
self,
self,
parameter,
minv=minv,
maxv=maxv,
step=step,
label=self.spin_format.format(
description=description, parameter=parameter
),
labelWidth=220,
spinType=_type,
callback=self.on_change,
)
spin.clearFocus()
spin.editingFinished.connect(self.on_change)

def on_change(self):
self.model = self.create_model()
Expand Down

0 comments on commit c82b4b4

Please sign in to comment.