Skip to content

Commit

Permalink
Make error statements in parameters.step more informative
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Dec 23, 2022
1 parent 09dabf7 commit e7ac972
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/suggestion/v1beta1/internal/search_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def convert_to_combinations(search_space):
combinations[parameter.name] = range(int(parameter.min), int(parameter.max)+1, int(parameter.step))
elif parameter.type == DOUBLE:
if parameter.step == "" or parameter.step is None:
raise Exception("Param {} step is nil".format(parameter.name))
raise Exception(
"Param {} step is nil; For discrete search space, all parameters must include step".
format(parameter.name)
)
double_list = np.arange(float(parameter.min), float(parameter.max)+float(parameter.step),
float(parameter.step))
if double_list[-1] > float(parameter.max):
Expand Down

0 comments on commit e7ac972

Please sign in to comment.