From 16f451b18a93edfa0902d13bc123519ea12aeef4 Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Tue, 3 Sep 2024 12:16:05 +0200 Subject: [PATCH] Fixup: gen_data can't be none as every everest config must have controls which turn into gendata --- src/ert/simulator/batch_simulator.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/ert/simulator/batch_simulator.py b/src/ert/simulator/batch_simulator.py index 919417e7b31..b16cc6b604b 100644 --- a/src/ert/simulator/batch_simulator.py +++ b/src/ert/simulator/batch_simulator.py @@ -102,24 +102,15 @@ def callback(*args, **kwargs): ) ) - if "gen_data" not in ens_config: - ens_config.addNode( - GenDataConfig( - keys=results, - input_files=[f"{k}_%d" for k in results], - report_steps_list=[[0] for _ in results], - ) - ) - else: - existing_gendata = ens_config.response_configs["gen_data"] - existing_keys = existing_gendata.keys - assert isinstance(existing_gendata, GenDataConfig) - - for key in results: - if key not in existing_keys: - existing_gendata.keys.append(key) - existing_gendata.input_files.append(f"{key}_%d") - existing_gendata.report_steps_list.append([0]) + existing_gendata = ens_config.response_configs["gen_data"] + existing_keys = existing_gendata.keys + assert isinstance(existing_gendata, GenDataConfig) + + for key in results: + if key not in existing_keys: + existing_gendata.keys.append(key) + existing_gendata.input_files.append(f"{key}_%d") + existing_gendata.report_steps_list.append([0]) def _setup_sim( self,