From b03ad67aac45f9d031faa5f986219c65fe0bb33f Mon Sep 17 00:00:00 2001 From: Jakob Langdal Date: Mon, 6 Feb 2023 22:58:50 +0100 Subject: [PATCH 1/2] Read extras.objectivePars --- optimizerapi/optimizer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/optimizerapi/optimizer.py b/optimizerapi/optimizer.py index 0e268bd..8f4aa51 100644 --- a/optimizerapi/optimizer.py +++ b/optimizerapi/optimizer.py @@ -184,6 +184,8 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space): # as "None" at the moment. graph_format = extras.get("graphFormat", "png") + objective_pars = extras.get("objectivePars", "result") + # In the following section details that should be reported to # clients should go into the "resultDetails" dictionary and plots # go into the "plots" list (this is handled by calling the "addPlot" function) @@ -206,7 +208,8 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space): plot_objective(model, dimensions=dimensions, usepartialdependence=False, - show_confidence=True) + show_confidence=True, + pars=objective_pars) add_plot(plots, f"objective_{idx}") if optimizer.n_objectives == 1: From e457d631b851383edef21f0ccbe13025dd6c7cca Mon Sep 17 00:00:00 2001 From: Jakob Langdal Date: Tue, 7 Feb 2023 14:13:56 +0000 Subject: [PATCH 2/2] Limit extras.objectivePars values --- optimizerapi/openapi/specification.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/optimizerapi/openapi/specification.yml b/optimizerapi/openapi/specification.yml index c25396a..5646029 100644 --- a/optimizerapi/openapi/specification.yml +++ b/optimizerapi/openapi/specification.yml @@ -121,6 +121,12 @@ components: extras: description: A plain JSON object that can contain arbitrary values type: object + properties: + objectivePars: + type: string + enum: + - result + - expected_minimum data: type: array items: