Skip to content

Commit

Permalink
Check for exact, then partial response key match
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Oct 23, 2024
1 parent ebc7df5 commit 458b278
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ert/dark_storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ def data_for_key(
key = key[6:]

response_key_to_response_type = ensemble.experiment.response_key_to_response_type
response_key = next((k for k in response_key_to_response_type if k in key), None)

# Check for exact match first. For example if key is "FOPRH"
# it may stop at "FOPR", which would be incorrect
response_key = next((k for k in response_key_to_response_type if k == key), None)
if response_key is None:
response_key = next(
(k for k in response_key_to_response_type if k in key), None
)

if response_key is not None:
response_type = response_key_to_response_type[response_key]
Expand Down

0 comments on commit 458b278

Please sign in to comment.