Skip to content

Commit

Permalink
Add logging of duplicate gen_kw parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Oct 31, 2024
1 parent c4e1365 commit 96725a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ert/config/ensemble_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ def __post_init__(self) -> None:
[p.name for p in self.parameter_configs.values()],
[key for config in self.response_configs.values() for key in config.keys],
)
gen_kw_params = Counter(
keyword
for p in self.parameter_configs.values()
if isinstance(p, GenKwConfig)
for keyword in p.getKeyWords()
)
duplicate_gen_kw_names = [(n, c) for n, c in gen_kw_params.items() if c > 1]

if duplicate_gen_kw_names:
duplicates_formatted = ", ".join(
f"{name}({count})" for name, count in duplicate_gen_kw_names
)
logger.info(
f"Found duplicate GEN_KW parameter names: {duplicates_formatted}"
)

self.grid_file = _get_abs_path(self.grid_file)

Expand Down

0 comments on commit 96725a3

Please sign in to comment.