From 9f35c36b97a9cecb3374abf13f5376b48790376a Mon Sep 17 00:00:00 2001 From: Jakob Langdal Date: Tue, 27 Jun 2023 09:12:55 +0000 Subject: [PATCH] Add pareto to default list --- optimizerapi/openapi/specification.yml | 1 + optimizerapi/optimizer.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/optimizerapi/openapi/specification.yml b/optimizerapi/openapi/specification.yml index 42a7487..e8402be 100644 --- a/optimizerapi/openapi/specification.yml +++ b/optimizerapi/openapi/specification.yml @@ -159,6 +159,7 @@ components: type: number graphs: type: array + default: ["objective", "convergence", "pareto"] items: type: string additionalProperties: diff --git a/optimizerapi/optimizer.py b/optimizerapi/optimizer.py index de797fd..cbc720f 100644 --- a/optimizerapi/optimizer.py +++ b/optimizerapi/optimizer.py @@ -228,7 +228,7 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space): # as "None" at the moment. graph_format = extras.get("graphFormat", "png") max_quality = int(extras.get("maxQuality", "5")) - graphs_to_return = extras.get("graphs", ['objective', 'convergence']) + graphs_to_return = extras.get("graphs", ['objective', 'convergence', 'pareto']) objective_pars = extras.get("objectivePars", "result") @@ -280,7 +280,7 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space): round_to_length_scales(minimum[0], optimizer.space), minimum[1], ] - else: + elif 'pareto' in graphs_to_return: plot_Pareto(optimizer) add_plot(plots, "pareto")