@@ -236,9 +236,9 @@ def _replace(s: str) -> str:
236236 )
237237 # loop over keys and calculate the KS matrix,
238238 # conditioning one parameter at the time.
239- updated_combinations = deepcopy (combinations )
240- for group_name , obs_group in combinations .items ():
241- print ("Processing:" , group_name )
239+ obs_group_to_observations = deepcopy (combinations )
240+ for obs_group , observations in combinations .items ():
241+ print ("Processing:" , obs_group )
242242
243243 # Use localization to evaluate change of parameters for each observation
244244 # The order of the context managers is important, as we want to create a new
@@ -261,7 +261,7 @@ def _replace(s: str) -> str:
261261 update_log = _run_ministep (
262262 prior_storage = prior_ensemble ,
263263 target_storage = target_ensemble ,
264- obs_group = obs_group ,
264+ observations = observations ,
265265 data_parameters = field_parameters + gen_kw_names ,
266266 observation_settings = observation_settings ,
267267 es_settings = es_settings ,
@@ -270,29 +270,29 @@ def _replace(s: str) -> str:
270270 # Get the active vs total observation info
271271 df_update_log = make_update_log_df (update_log )
272272 except ErtAnalysisError :
273- logger .error (f"Analysis failed for: { obs_group } " )
274- del updated_combinations [ group_name ]
273+ logger .error (f"Analysis failed for: { observations } " )
274+ del obs_group_to_observations [ obs_group ]
275275 continue
276276 # Get the updated scalar parameter distributions
277277 target_ensemble .load_all_gen_kw_data ().to_csv (
278- ahmanalysis_reports_dir / f"{ group_name } .csv"
278+ ahmanalysis_reports_dir / f"{ obs_group } .csv"
279279 )
280280
281- active_obs .at ["ratio" , group_name ] = (
281+ active_obs .at ["ratio" , obs_group ] = (
282282 str (count_active_observations (df_update_log ))
283283 + " active/"
284284 + str (len (df_update_log .index ))
285285 )
286286 # Get misfit values
287- misfitval [group_name ] = [
287+ misfitval [obs_group ] = [
288288 calc_observationsgroup_misfit (
289- group_name ,
289+ obs_group ,
290290 df_update_log ,
291291 LibresFacade .load_all_misfit_data (prior_ensemble ),
292292 )
293293 ]
294294 # Calculate Ks matrix for scalar parameters
295- kolmogorov_smirnov_data [group_name ] = kolmogorov_smirnov_data [
295+ kolmogorov_smirnov_data [obs_group ] = kolmogorov_smirnov_data [
296296 "Parameters"
297297 ].map (
298298 calc_kolmogorov_smirnov (
@@ -344,7 +344,7 @@ def make_update_log_df(update_log: SmootherSnapshot) -> pd.DataFrame:
344344def _run_ministep (
345345 prior_storage : Ensemble ,
346346 target_storage : Ensemble ,
347- obs_group : Iterable [str ],
347+ observations : Iterable [str ],
348348 data_parameters : Iterable [str ],
349349 observation_settings : ObservationSettings ,
350350 es_settings : ESSettings ,
@@ -355,7 +355,7 @@ def _run_ministep(
355355 return smoother_update (
356356 prior_storage = prior_storage ,
357357 posterior_storage = target_storage ,
358- observations = obs_group ,
358+ observations = observations ,
359359 parameters = data_parameters ,
360360 update_settings = copy .deepcopy (observation_settings ),
361361 es_settings = es_settings ,
0 commit comments