Skip to content

Commit

Permalink
doe: catch ConstraintNotFulfilledError (#251)
Browse files Browse the repository at this point in the history
* catch ConstraintNotFulfilledError

* remove basic_examples.ipynb from blacklist
  • Loading branch information
Osburg authored Aug 4, 2023
1 parent 3930ff9 commit 2f2994c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bofire/strategies/doe/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from formulaic import Formula
from scipy.optimize._minimize import standardize_constraints

from bofire.data_models.constraints.api import NChooseKConstraint, NonlinearConstraint
from bofire.data_models.constraints.api import (
ConstraintNotFulfilledError,
NChooseKConstraint,
NonlinearConstraint,
)
from bofire.data_models.domain.api import Domain
from bofire.data_models.enum import SamplingMethodEnum
from bofire.data_models.strategies.api import (
Expand Down Expand Up @@ -180,7 +184,7 @@ def find_local_max_ipopt(
only_inputs=True,
tol=1e-4,
)
except ValueError:
except (ValueError, ConstraintNotFulfilledError):
warnings.warn(
"Some points do not lie inside the domain or violate constraints. Please check if the \
results lie within your tolerance.",
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run_tutorials(

# ToDo: take care
# here are notebooks which are not tested due to random issues
blacklist = ["basic_examples.ipynb"]
blacklist = []

for tutorial in tutorials:
print(42 * "#", tutorial)
Expand Down

0 comments on commit 2f2994c

Please sign in to comment.