Skip to content

Commit

Permalink
Create design matrices before hand
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 18, 2024
1 parent 01156bb commit be90d35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ert/config/analysis_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AnalysisConfig:
ies_module: IESSettings = field(default_factory=IESSettings)
observation_settings: UpdateSettings = field(default_factory=UpdateSettings)
num_iterations: int = 1
design_matrix: DesignMatrix | None = None
design_matrices: list[DesignMatrix] = field(default_factory=list)

@no_type_check
@classmethod
Expand Down Expand Up @@ -81,7 +81,7 @@ def from_dict(cls, config_dict: ConfigDict) -> AnalysisConfig:

min_realization = min(min_realization, num_realization)

design_matrix_config_list = config_dict.get(ConfigKeys.DESIGN_MATRIX, None)
design_matrix_config_lists = config_dict.get(ConfigKeys.DESIGN_MATRIX, [])

options: dict[str, dict[str, Any]] = {"STD_ENKF": {}, "IES_ENKF": {}}
observation_settings: dict[str, Any] = {
Expand Down Expand Up @@ -187,16 +187,18 @@ def from_dict(cls, config_dict: ConfigDict) -> AnalysisConfig:
if all_errors:
raise ConfigValidationError.from_collected(all_errors)

design_matrices = [
DesignMatrix.from_config_list(design_matrix_config_list)
for design_matrix_config_list in design_matrix_config_lists
]
config = cls(
max_runtime=config_dict.get(ConfigKeys.MAX_RUNTIME),
minimum_required_realizations=min_realization,
update_log_path=config_dict.get(ConfigKeys.UPDATE_LOG_PATH, "update_log"),
observation_settings=obs_settings,
es_module=es_settings,
ies_module=ies_settings,
design_matrix=DesignMatrix.from_config_list(design_matrix_config_list)
if design_matrix_config_list is not None
else None,
design_matrices=design_matrices,
)
return config

Expand Down

0 comments on commit be90d35

Please sign in to comment.