Skip to content

Commit

Permalink
Normalize objective option check and improve debug output in tests so…
Browse files Browse the repository at this point in the history
… that get_deviating_options passes
  • Loading branch information
sgbaird committed Mar 1, 2025
1 parent 69bf5c8 commit 2037146
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/honegumi/ax/_ax.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def is_incompatible(opt):
model_is_fully_bayesian = opt[cst.MODEL_OPT_KEY] == cst.FULLYBAYESIAN_KEY
# use_custom_threshold = opt.get(cst.CUSTOM_THRESHOLD_KEY, False)
use_custom_threshold = opt[cst.CUSTOM_THRESHOLD_KEY]
objective_is_single = opt[cst.OBJECTIVE_OPT_KEY] == "Single"
objective_is_single = opt[cst.OBJECTIVE_OPT_KEY].lower() == "single"

checks = [
model_is_fully_bayesian and not use_custom_gen,
Expand Down
7 changes: 2 additions & 5 deletions tests/test_honegumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def test_honegumi():


def test_get_deviating_options():

option_names_shortlist = [
"objective",
"model",
Expand All @@ -51,17 +50,15 @@ def test_get_deviating_options():
hg = Honegumi(cst, option_rows_short, is_incompatible_fn=is_incompatible)

deviating_options = hg.get_deviating_options(current_config)
print(deviating_options)
print("Deviating options:", deviating_options) # Debug print

# Add assertions to verify the expected deviating options
expected_deviating_options = [{"custom_threshold": True}]
if deviating_options != expected_deviating_options:
raise AssertionError(
f"Expected deviating options: {expected_deviating_options}, but got: {deviating_options}" # noqa: E501
f"Expected deviating options: {expected_deviating_options}, but got: {deviating_options}" # noqa
)

1 + 1


def test_main(capsys):
"""CLI Tests"""
Expand Down

0 comments on commit 2037146

Please sign in to comment.