8
8
9
9
import numpy as np
10
10
11
- from ert .config import ErtConfig , ESSettings , HookRuntime , UpdateSettings
11
+ from ert .config import (
12
+ ErtConfig ,
13
+ ESSettings ,
14
+ HookRuntime ,
15
+ ParameterConfig ,
16
+ ScalarParameters ,
17
+ UpdateSettings ,
18
+ )
12
19
from ert .config .parsing .config_errors import ConfigValidationError
13
- from ert .enkf_main import sample_prior , save_design_matrix_to_ensemble
20
+ from ert .enkf_main import sample_prior
14
21
from ert .ensemble_evaluator import EvaluatorServerConfig
15
22
from ert .storage import Ensemble , Storage
16
23
from ert .trace import tracer
@@ -103,14 +110,21 @@ def run_experiment(
103
110
104
111
parameters_config = self ._parameter_configuration
105
112
design_matrix = self ._design_matrix
106
- design_matrix_group = None
113
+ parameters_config : list [ParameterConfig ] = []
114
+ design_matrix = self ._design_matrix
107
115
if design_matrix is not None :
108
- try :
109
- parameters_config , design_matrix_group = (
110
- design_matrix .merge_with_existing_parameters (parameters_config )
111
- )
112
- except ConfigValidationError as exc :
113
- raise ErtRunError (str (exc )) from exc
116
+ for param in self ._parameter_configuration :
117
+ if isinstance (param , ScalarParameters ):
118
+ try :
119
+ new_scalar_config = (
120
+ design_matrix .merge_with_existing_parameters (param )
121
+ )
122
+ parameters_config .append (new_scalar_config )
123
+ except ConfigValidationError as exc :
124
+ raise ErtRunError (str (exc )) from exc
125
+ else :
126
+ parameters_config .append (param )
127
+ self ._parameter_configuration = parameters_config
114
128
115
129
self .restart = restart
116
130
if self .restart_run :
@@ -138,8 +152,7 @@ def run_experiment(
138
152
)
139
153
sim_args = {"weights" : self ._relative_weights }
140
154
experiment = self ._storage .create_experiment (
141
- parameters = parameters_config
142
- + ([design_matrix_group ] if design_matrix_group else []),
155
+ parameters = parameters_config ,
143
156
observations = self ._observations ,
144
157
responses = self ._response_configuration ,
145
158
simulation_arguments = sim_args ,
@@ -164,15 +177,13 @@ def run_experiment(
164
177
prior ,
165
178
np .where (self .active_realizations )[0 ],
166
179
random_seed = self .random_seed ,
180
+ design_matrix_df = (
181
+ design_matrix .design_matrix_df
182
+ if design_matrix is not None
183
+ else None
184
+ ),
167
185
)
168
186
169
- if design_matrix_group is not None and design_matrix is not None :
170
- save_design_matrix_to_ensemble (
171
- design_matrix .design_matrix_df ,
172
- prior ,
173
- np .where (self .active_realizations )[0 ],
174
- design_matrix_group .name ,
175
- )
176
187
self ._evaluate_and_postprocess (
177
188
prior_args ,
178
189
prior ,
0 commit comments