Skip to content

Commit fac54c0

Browse files
committed
Verify lb is less than ub
1 parent 82f865b commit fac54c0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bayes_opt/constraint.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ def __init__(self, fun, lb, ub, random_state=None):
4949
self._ub = np.array([ub])
5050
else:
5151
self._ub = ub
52-
53-
52+
53+
if np.any(self._lb >= self._ub):
54+
msg = "Lower bounds must be less than upper bounds."
55+
raise ValueError(msg)
56+
5457
basis = lambda: GaussianProcessRegressor(
5558
kernel=Matern(nu=2.5),
5659
alpha=1e-6,

0 commit comments

Comments
 (0)