Skip to content

Commit

Permalink
Add test for summary response reading past 2263
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Oct 4, 2024
1 parent 3e1b012 commit 2769d67
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/ert/unit_tests/scenarios/test_summary_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
]

0 comments on commit 2769d67

Please sign in to comment.