Skip to content

Commit

Permalink
Raise Validation error when having multiple overlapping groups
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 28, 2024
1 parent eade566 commit 5edc8d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ert/config/design_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ def merge_with_existing_parameters(
continue
existing_keys = [e.name for e in parameter_group.transform_functions]
if set(existing_keys) == set(design_keys):
if design_group_added:
raise ConfigValidationError(
(
"Multiple overlapping groups with design matrix found in existing parameters!\n"
f"{design_parameter_group.name} and {parameter_group.name}"
)
)

design_parameter_group.name = parameter_group.name
design_group_added = True
elif set(design_keys) & set(existing_keys):
Expand All @@ -129,8 +137,6 @@ def merge_with_existing_parameters(
)
else:
new_param_config += [parameter_group]
if not design_group_added:
new_param_config += [design_parameter_group]
return new_param_config, design_parameter_group

def read_design_matrix(
Expand Down

0 comments on commit 5edc8d7

Please sign in to comment.