From f38ff0cc8147faaa9973b2e445598ce9c44d709a Mon Sep 17 00:00:00 2001 From: Saad Khan Date: Fri, 22 Apr 2022 16:01:36 +0530 Subject: [PATCH] Add API for function variables, Remove Slo class from search_space Signed-off-by: Saad Khan --- src/json_validate.py | 5 ++--- src/service.py | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/json_validate.py b/src/json_validate.py index 7bc39a9..add48c7 100644 --- a/src/json_validate.py +++ b/src/json_validate.py @@ -41,11 +41,10 @@ "upper_bound": {"type": "number"}, "step": {"type": "number"}, "choices":{"type":"array"} - }, - "slo_class": {"type": "string"}, + }, "direction": {"type": "string"}, }, - "required": ["experiment_name", "experiment_id", "total_trials", "objective_function", "tunables", "direction"] + "required": ["experiment_name", "total_trials", "objective_function", "tunables", "direction"] } }, "required": ["search_space", "operation"], diff --git a/src/service.py b/src/service.py index a5d4d2e..8554054 100644 --- a/src/service.py +++ b/src/service.py @@ -160,14 +160,13 @@ def get_search_create_study(search_space_json, operation): hpo_service.instance.startExperiment(id_) -def get_search_space(id_, url): - """Perform a GET request and return the search space json.""" - params = {"id": id_} - r = requests.get(url, params) +# TODO: Update below API +def get_function_variables(url): + """Perform a GET request and get the function variables""" + r = requests.get(url) r.raise_for_status() - search_space_json = r.json() - return search_space_json - + function_variable_json = r.json() + return function_variable_json def main():