Skip to content

Commit

Permalink
Fixup: gen_data can't be none
Browse files Browse the repository at this point in the history
as every everest config must have
controls which turn into gendata
  • Loading branch information
Yngve S. Kristiansen committed Sep 3, 2024
1 parent 091cf42 commit 16f451b
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/ert/simulator/batch_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 16f451b

Please sign in to comment.