Skip to content

Commit 14a9189

Browse files
committed
add logging info for parameter that uses e notation to inform them that the parameter gets deduced as float
1 parent 300b5a3 commit 14a9189

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

neps/search_spaces/yaml_search_space_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from __future__ import annotations
22

3+
import logging
34
import re
45

6+
logger = logging.getLogger(__name__)
7+
58

69
def convert_scientific_notation(value: str | int | float, show_usage_flag=False) \
7-
-> float | (float, bool):
10+
-> float | (float, bool):
811
"""
912
Convert a given value to a float if it's a string that matches scientific e notation.
1013
This is especially useful for numbers like "3.3e-5" which YAML parsers may not
@@ -156,6 +159,10 @@ def deduce_param_type(name: str, details: dict[str, int | str | float]) -> str:
156159

157160
# check if one value is e notation and if so convert it to float
158161
if flag_lower or flag_upper:
162+
logger.info(
163+
f"Because of e notation, Parameter {name} gets "
164+
f"interpreted as float"
165+
)
159166
param_type = "float"
160167
else:
161168
raise TypeError(

0 commit comments

Comments
 (0)