From 14a9189255ca2e108a5bbbe6a92027c0f5273f80 Mon Sep 17 00:00:00 2001 From: Daniel <63580393+danrgll@users.noreply.github.com> Date: Sat, 30 Dec 2023 11:55:40 +0100 Subject: [PATCH] add logging info for parameter that uses e notation to inform them that the parameter gets deduced as float --- neps/search_spaces/yaml_search_space_utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/neps/search_spaces/yaml_search_space_utils.py b/neps/search_spaces/yaml_search_space_utils.py index e0efe616..d8063519 100644 --- a/neps/search_spaces/yaml_search_space_utils.py +++ b/neps/search_spaces/yaml_search_space_utils.py @@ -1,10 +1,13 @@ from __future__ import annotations +import logging import re +logger = logging.getLogger(__name__) + def convert_scientific_notation(value: str | int | float, show_usage_flag=False) \ - -> float | (float, bool): + -> float | (float, bool): """ Convert a given value to a float if it's a string that matches scientific e notation. 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: # check if one value is e notation and if so convert it to float if flag_lower or flag_upper: + logger.info( + f"Because of e notation, Parameter {name} gets " + f"interpreted as float" + ) param_type = "float" else: raise TypeError(