diff --git a/src/ert/config/ensemble_config.py b/src/ert/config/ensemble_config.py index 91026bde8e6..0908cad5610 100644 --- a/src/ert/config/ensemble_config.py +++ b/src/ert/config/ensemble_config.py @@ -152,21 +152,6 @@ def hasNodeGenData(self, key: str) -> bool: config = self.response_configs["gen_data"] return key in config.keys - def addNode(self, config_node: Union[ParameterConfig, ResponseConfig]) -> None: - assert config_node is not None - if config_node.name in self: - raise ConfigValidationError( - f"Config node with key {config_node.name!r} already present in ensemble config" - ) - - if isinstance(config_node, ParameterConfig): - logger.info( - f"Adding {type(config_node).__name__} config (of size {len(config_node)}) to parameter_configs" - ) - self.parameter_configs[config_node.name] = config_node - else: - self.response_configs[config_node.name] = config_node - def get_keylist_gen_kw(self) -> List[str]: return [ val.name diff --git a/src/everest/simulator/everest_to_ert.py b/src/everest/simulator/everest_to_ert.py index 8916f481489..d4dce80ab7f 100644 --- a/src/everest/simulator/everest_to_ert.py +++ b/src/everest/simulator/everest_to_ert.py @@ -538,7 +538,7 @@ def _get_variables( # configuration key. When initializing an ERT config object, it is ignored. # It is used by the Simulator object to inject ExtParamConfig nodes. for control in ever_config.controls or []: - ens_config.addNode( + ens_config.parameter_configs[control.name] = ( ExtParamConfig( name=control.name, input_keys=_get_variables(control.variables), diff --git a/tests/ert/unit_tests/simulator/test_batch_sim.py b/tests/ert/unit_tests/simulator/test_batch_sim.py index 5e961e07db4..dfbbb950163 100644 --- a/tests/ert/unit_tests/simulator/test_batch_sim.py +++ b/tests/ert/unit_tests/simulator/test_batch_sim.py @@ -49,21 +49,17 @@ def __init__(self, ert_config, storage, controls, results, callback=None): try: ens_config = ert_config.ensemble_config for control_name, variables in controls.items(): - ens_config.addNode( - ExtParamConfig( - name=control_name, - input_keys=variables, - output_file=control_name + ".json", - ) + ens_config.parameter_configs[control_name] = ExtParamConfig( + name=control_name, + input_keys=variables, + output_file=control_name + ".json", ) if "gen_data" not in ens_config: - ens_config.addNode( - GenDataConfig( - keys=results, - input_files=[f"{k}" for k in results], - report_steps_list=[None for _ in results], - ) + ens_config.response_configs["gen_data"] = GenDataConfig( + keys=results, + input_files=[f"{k}" for k in results], + report_steps_list=[None for _ in results], ) else: existing_gendata = ens_config.response_configs["gen_data"]