Skip to content

Commit e7ac972

Browse files
committed
Make error statements in parameters.step more informative
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 09dabf7 commit e7ac972

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/suggestion/v1beta1/internal/search_space.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def convert_to_combinations(search_space):
4949
combinations[parameter.name] = range(int(parameter.min), int(parameter.max)+1, int(parameter.step))
5050
elif parameter.type == DOUBLE:
5151
if parameter.step == "" or parameter.step is None:
52-
raise Exception("Param {} step is nil".format(parameter.name))
52+
raise Exception(
53+
"Param {} step is nil; For discrete search space, all parameters must include step".
54+
format(parameter.name)
55+
)
5356
double_list = np.arange(float(parameter.min), float(parameter.max)+float(parameter.step),
5457
float(parameter.step))
5558
if double_list[-1] > float(parameter.max):

0 commit comments

Comments
 (0)