Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
langdal committed Feb 9, 2023
1 parent 01118d0 commit 3d17fe8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion optimizerapi/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space):
experiment_suggestion_count = extras["experimentSuggestionCount"]

next_exp = optimizer.ask(n_points=experiment_suggestion_count)
if not any(isinstance(x, list) for x in next_exp): next_exp = [next_exp]
if len(next_exp) > 0 and not any(isinstance(x, list) for x in next_exp): next_exp = [next_exp]
result_details["next"] = round_to_length_scales(next_exp, optimizer.space)

if len(data) >= cfg["initialPoints"]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def validateResult(result):
assert "result" in result
assert "models" in result["result"]
assert "next" in result["result"]
assert len(result["result"]["next"]) == len(sampleConfig["space"])
assert all(len(x) == len(sampleConfig["space"]) for x in result["result"]["next"])
assert "pickled" in result["result"]
assert len(result["result"]["pickled"]) > 1
if len(result["result"]["models"]) > 0:
Expand Down

0 comments on commit 3d17fe8

Please sign in to comment.