Skip to content

Commit 152ce10

Browse files
committed
BUG: Fix incorrect condition for OptimizationToleranceReached
Fixes: #4
1 parent 4973e46 commit 152ce10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sambo/_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def __call__(self, *args, **kwargs):
155155
raise self.MaximumFunctionEvaluationsReached
156156
if self.tol is not None and len(self.funv) >= self.n_iter_no_change:
157157
y_min = heapq.nsmallest(self.n_iter_no_change, self.funv)
158-
if y_min[0] < y_min[-1] and y_min[-1] - y_min[0] < self.tol:
158+
if y_min[0] <= y_min[-1] and y_min[-1] - y_min[0] < self.tol:
159159
raise self.OptimizationToleranceReached
160160
return y
161161

0 commit comments

Comments
 (0)