Skip to content

Commit 30ae95f

Browse files
committed
fixup! Fix logging of missing wildcard rft responses
1 parent 949dc4a commit 30ae95f

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

src/ert/config/rft_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ def _warn_about_missing_rft_responses(
300300

301301
well_times_to_warn: set[tuple[str, str]] = well_times - well_times_with_response
302302

303-
# Only warn about wells with wildcard times if well have
304-
# no responses at any time.
303+
# Given well / time wildcard, only warn if there are no responses for
304+
# the corresponding well / time value
305305
wells_with_responses = {well for well, time in well_times_with_response}
306306
times_with_responses = {time for well, time in well_times_with_response}
307307
for well, time in copy(well_times_to_warn):
@@ -310,6 +310,7 @@ def _warn_about_missing_rft_responses(
310310
if time == "*" and well in wells_with_responses:
311311
well_times_to_warn.remove((well, time))
312312

313+
# Only warn about wildcard well and time if there are no responses
313314
if (wildcard_well_time := ("*", "*")) in well_times and len(
314315
well_times_with_response
315316
) > 0:

tests/ert/unit_tests/config/test_rft_config.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,22 +1447,6 @@ def test_that_wildcard_wells_are_warned_about_given_no_time_response(
14471447
assert any(all(e_w in str(w) for e_w in expected_warnings) for w in warnings)
14481448

14491449

1450-
def test_that_wildcard_wells_with_time_response_are_not_warned_about(
1451-
setup_mock_resfo_file,
1452-
):
1453-
rft_config = RFTConfig(
1454-
input_files=["BASE.RFT"],
1455-
data_to_read={
1456-
"*": {"2000-01-01": ["PRESSURE", "SWAT"]},
1457-
},
1458-
)
1459-
with warnings.catch_warnings():
1460-
warnings.simplefilter( # Asserts no PostExperimentWarnings were raised
1461-
"error", PostExperimentWarning
1462-
)
1463-
rft_config.read_from_file("/tmp/does_not_exist", 1, 1)
1464-
1465-
14661450
def test_that_wildcard_well_with_wildcard_time_without_any_response_is_warned_about(
14671451
mock_resfo_file, egrid
14681452
):

0 commit comments

Comments
 (0)