From 41aae5df518affcda17f9fd768ff45f65c544ca2 Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Wed, 2 Oct 2024 09:49:06 +0200 Subject: [PATCH] Add test for summary response reading past 2263 --- .../scenarios/test_summary_response.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/ert/unit_tests/scenarios/test_summary_response.py b/tests/ert/unit_tests/scenarios/test_summary_response.py index 5d03c290ae4..bb07dddaf74 100644 --- a/tests/ert/unit_tests/scenarios/test_summary_response.py +++ b/tests/ert/unit_tests/scenarios/test_summary_response.py @@ -236,3 +236,36 @@ def test_that_mismatched_responses_gives_nan_measured_data(ert_config, prior_ens assert pd.isna(fopr_2.loc[0].iloc[0]) assert pd.isna(fopr_2.loc[1].iloc[0]) assert pd.isna(fopr_1.loc[2].iloc[0]) + + +def test_reading_past_2263_is_ok(ert_config, storage, prior_ensemble): + sample_prior(prior_ensemble, range(prior_ensemble.ensemble_size)) + + create_responses( + ert_config.user_config_file, + prior_ensemble, + ert_config.model_config.num_realizations * [[datetime(2500, 9, 9)]], + ) + + responses = prior_ensemble.load_responses("summary", (0, 1, 2)) + assert np.isclose( + [-1.6038368, 0.06409992, 0.7408913], responses["values"].to_numpy() + ).all() + + assert responses[["realization", "response_key", "time"]].to_dicts() == [ + { + "realization": 0, + "response_key": "FOPR", + "time": datetime(2500, 9, 10, 0, 0), + }, + { + "realization": 1, + "response_key": "FOPR", + "time": datetime(2500, 9, 10, 0, 0), + }, + { + "realization": 2, + "response_key": "FOPR", + "time": datetime(2500, 9, 10, 0, 0), + }, + ]