From 610fc36d39399a2cca6d0abcd00e2a7d2af1421f Mon Sep 17 00:00:00 2001 From: Jakob Langdal Date: Sat, 19 Aug 2023 09:27:18 +0000 Subject: [PATCH] Only add modelled noise if result contains a model --- optimizerapi/optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimizerapi/optimizer.py b/optimizerapi/optimizer.py index 1e55e40..633778e 100644 --- a/optimizerapi/optimizer.py +++ b/optimizerapi/optimizer.py @@ -159,7 +159,7 @@ def __handle_run(body) -> dict: if n_objectives == 1: Yi = [elm[0] for elm in Yi] result = optimizer.tell(Xi, Yi) - if n_objectives == 1: + if n_objectives == 1 and len(result.models) > 0: if use_actual_measurement_histogram: optimizer.add_modelled_noise() result = optimizer.get_result()