Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging of duplicate gen_kw parameter names #9086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
[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()

Check failure on line 65 in src/ert/config/ensemble_config.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

"GenKwConfig" has no attribute "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
Loading