Skip to content

Commit

Permalink
Add unit tests for optuna suggestion service
Browse files Browse the repository at this point in the history
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Dec 13, 2022
1 parent 31b2d82 commit 9990aca
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 271 deletions.
7 changes: 3 additions & 4 deletions pkg/suggestion/v1beta1/optuna/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import threading
import grpc
import logging

import itertools

from pkg.apis.manager.v1beta1.python import api_pb2
Expand Down Expand Up @@ -193,11 +192,11 @@ def _validate_grid_setting(cls, experiment):

for s in algorithm_settings:
try:
if s.name == "seed":
if s.name == "random_state":
if not int(s.value) >= 0:
return False, ""
else:
return False, "unknown setting {} for algorithm grid".format(s.name)
else:
return False, "unknown setting {} for algorithm grid".format(s.name)

except Exception as e:
return False, "failed to validate {name}({value}): {exception}".format(name=s.name, value=s.value,
Expand Down
Loading

0 comments on commit 9990aca

Please sign in to comment.