Skip to content

Commit 36ec169

Browse files
committed
OWNeighbours: Replace 'commit' with lambda
1 parent b7e502e commit 36ec169

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Orange/widgets/data/owneighbors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ def __init__(self):
7777
callback=self.recompute)
7878
gui.spin(
7979
box, self, "n_neighbors", label="Number of neighbors:",
80-
step=1, spinType=int, minv=0, maxv=100, callback=self.commit)
80+
step=1, spinType=int, minv=0, maxv=100,
81+
# call apply by gui.auto_commit, pylint: disable=unnecessary-lambda
82+
callback=lambda: self.apply())
8183
gui.checkBox(
8284
box, self, "exclude_reference",
8385
label="Exclude rows (equal to) references",
84-
callback=self.commit)
86+
# call apply by gui.auto_commit, pylint: disable=unnecessary-lambda
87+
callback=lambda: self.apply())
8588

8689
self.apply_button = gui.auto_commit(
8790
self.controlArea, self, "auto_apply", "&Apply", commit=self.apply)
@@ -137,9 +140,6 @@ def compute_distances(self):
137140
pp_reference, pp_data = pp_all_data[:n_ref], pp_all_data[n_ref:]
138141
self.distances = metric(pp_data, pp_reference).min(axis=1)
139142

140-
def commit(self):
141-
self.apply()
142-
143143
def apply(self):
144144
indices = self._compute_indices()
145145
if indices is None:

0 commit comments

Comments
 (0)