Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Apr 26, 2024
2 parents e8a1201 + 95a7dbd commit 1d79b58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion smt/utils/design_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def add_value_constraint(
isinstance(param2, UniformFloatHyperparameter)
):
if isinstance(value1, Sequence):
clause1 = ForbiddenInClause(param1, str(value1))
clause1 = ForbiddenInClause(param1, list(np.atleast_1d(np.array(value1, dtype=str))))
else:
clause1 = ForbiddenEqualsClause(param1, str(value1))

Expand Down
4 changes: 2 additions & 2 deletions smt/utils/test/test_design_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def test_design_space_hierarchical(self):
def test_design_space_hierarchical_config_space(self):
ds = DesignSpace(
[
CategoricalVariable(["A", "B", "C"]), # x0
CategoricalVariable(["A", "B", "Cc"]), # x0
CategoricalVariable(["E", "F"]), # x1
IntegerVariable(0, 1), # x2
FloatVariable(0, 1), # x3
Expand All @@ -442,7 +442,7 @@ def test_design_space_hierarchical_config_space(self):
decreed_var=3, meta_var=0, meta_value="A"
) # Activate x3 if x0 == A
ds.add_value_constraint(
var1=0, value1="C", var2=1, value2="F"
var1=0, value1=["Cc"], var2=1, value2="F"
) # Prevent a == C and b == F

x_cartesian = np.array(
Expand Down

0 comments on commit 1d79b58

Please sign in to comment.