diff --git a/src/ert/analysis/_es_update.py b/src/ert/analysis/_es_update.py index 45c2bd69624..fde8e11cf6d 100644 --- a/src/ert/analysis/_es_update.py +++ b/src/ert/analysis/_es_update.py @@ -261,6 +261,10 @@ def _load_observations_and_responses( iens_active_index, ) + observations_and_responses = observations_and_responses.sort( + by=["observation_key", "index"] + ) + S = observations_and_responses.select( observations_and_responses.columns[5:] ).to_numpy() diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_only_using_subset_observations/0/update_log b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_only_using_subset_observations/0/update_log index 0bddd5859fe..ef3df8838e6 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_only_using_subset_observations/0/update_log +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_only_using_subset_observations/0/update_log @@ -1,6 +1,6 @@ ---------- --------- ----- ----- ----- ----- ------ ----- ------ -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Active WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Active +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active ---------- --------- ----- ----- ----- ----- ------ ----- ------ diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess0/update_log b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess0/update_log index 410d07519a4..c3046ca1832 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess0/update_log +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess0/update_log @@ -205,8 +205,8 @@ WOPR_OP1_190 2015-03-15 00:00:00.000 0.015 0.010 1.732 0.017 0.042 0.041 WOPR_OP1_36 2010-12-26 00:00:00.000 0.700 0.070 1.732 0.121 0.650 0.084 Active WOPR_OP1_72 2011-12-21 00:00:00.000 0.500 0.050 1.000 0.050 0.405 0.170 Active WOPR_OP1_9 2010-03-31 00:00:00.000 0.100 0.050 1.732 0.087 0.096 0.060 Active -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Active WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Active +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active ------------ ----------------------- ----- ----- ----- ----- ------ ----- ------ diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess1/update_log b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess1/update_log index a0bd117d407..bf5df079e89 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess1/update_log +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess1/update_log @@ -205,8 +205,8 @@ WOPR_OP1_190 2015-03-15 00:00:00.000 0.015 0.010 1.000 0.010 0.042 0.041 WOPR_OP1_36 2010-12-26 00:00:00.000 0.700 0.070 1.000 0.070 0.650 0.084 Active WOPR_OP1_72 2011-12-21 00:00:00.000 0.500 0.050 1.000 0.050 0.405 0.170 Active WOPR_OP1_9 2010-03-31 00:00:00.000 0.100 0.050 1.000 0.050 0.096 0.060 Active -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Active WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Active +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active ------------ ----------------------- ----- ----- ----- ----- ------ ----- ------ diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess2/update_log b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess2/update_log index 185252417e0..1d889e46ebe 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess2/update_log +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess2/update_log @@ -205,8 +205,8 @@ WOPR_OP1_190 2015-03-15 00:00:00.000 0.015 0.010 1.000 0.010 0.042 0.041 WOPR_OP1_36 2010-12-26 00:00:00.000 0.700 0.070 1.000 0.070 0.650 0.084 Active WOPR_OP1_72 2011-12-21 00:00:00.000 0.500 0.050 1.000 0.050 0.405 0.170 Active WOPR_OP1_9 2010-03-31 00:00:00.000 0.100 0.050 1.000 0.050 0.096 0.060 Active -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Active WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Active +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active ------------ ----------------------- ----- ----- ----- ----- ------ ----- ------ diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess3/update_log b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess3/update_log index 6023b63ed2d..f0d91911faf 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess3/update_log +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report/0-misfit_preprocess3/update_log @@ -205,8 +205,8 @@ WOPR_OP1_190 2015-03-15 00:00:00.000 0.015 0.010 1.414 0.014 0.042 0.041 WOPR_OP1_36 2010-12-26 00:00:00.000 0.700 0.070 1.000 0.070 0.650 0.084 Active WOPR_OP1_72 2011-12-21 00:00:00.000 0.500 0.050 1.000 0.050 0.405 0.170 Active WOPR_OP1_9 2010-03-31 00:00:00.000 0.100 0.050 1.000 0.050 0.096 0.060 Active -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Active WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Active +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Active +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Active ------------ ----------------------- ----- ----- ----- ----- ------ ----- ------ diff --git a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report_with_exception_in_analysis_ES/0/error_event b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report_with_exception_in_analysis_ES/0/error_event index 1f51a76e394..eaa94298638 100644 --- a/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report_with_exception_in_analysis_ES/0/error_event +++ b/tests/ert/unit_tests/analysis/snapshots/test_es_update/test_update_report_with_exception_in_analysis_ES/0/error_event @@ -205,8 +205,8 @@ WOPR_OP1_190 2015-03-15 00:00:00.000 0.015 0.010 1.000 0.010 0.042 0.041 WOPR_OP1_36 2010-12-26 00:00:00.000 0.700 0.070 1.000 0.070 0.650 0.084 Deactivated, outlier WOPR_OP1_72 2011-12-21 00:00:00.000 0.500 0.050 1.000 0.050 0.405 0.170 Deactivated, outlier WOPR_OP1_9 2010-03-31 00:00:00.000 0.100 0.050 1.000 0.050 0.096 0.060 Deactivated, outlier -WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Deactivated, outlier -WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Deactivated, outlier WPR_DIFF_1 199, 1200 0.200 0.150 1.000 0.150 0.073 0.130 Deactivated, outlier WPR_DIFF_1 199, 1800 0.000 0.050 1.000 0.050 0.127 0.125 Deactivated, outlier +WPR_DIFF_1 199, 400 0.000 0.100 1.000 0.100 -0.011 0.060 Deactivated, outlier +WPR_DIFF_1 199, 800 0.100 0.200 1.000 0.200 0.081 0.126 Deactivated, outlier ------------ ----------------------- ----- ----- ----- ----- ------ ----- -------------------- diff --git a/tests/ert/unit_tests/analysis/test_es_update.py b/tests/ert/unit_tests/analysis/test_es_update.py index 14cc02d125e..4767948e9b6 100644 --- a/tests/ert/unit_tests/analysis/test_es_update.py +++ b/tests/ert/unit_tests/analysis/test_es_update.py @@ -222,31 +222,31 @@ def test_update_report_with_different_observation_status_from_smoother_update( ( "IES_ENKF", [ - 0.5167529669896218, - -0.9178847938402281, - -0.6299046429604261, - -0.1632005925319205, - 0.0216488942750398, - 0.07464619425897459, - -1.5587692532545538, - 0.22910522740018124, - -0.7171489000139469, - 0.7287252249699406, + 0.6038000995616932, + -0.8995579663087738, + -0.650440718033405, + -0.11664520562571357, + 0.14637004546145008, + 0.06369104020984925, + -1.5673340724477953, + 0.2045320804879709, + -0.8182935847537811, + 0.7551499933992224, ], ), ( "STD_ENKF", [ - 1.3040645145742686, - -0.8162878122658299, - -1.5484856041224397, - -1.379896334985399, - -0.510970027650022, - 0.5638868158813687, - -2.7669280724377487, - 1.7160680670028017, - -1.2603717378211836, - 1.2014197463741136, + 1.7365584618531105, + -0.819068074727709, + -1.6628460358849138, + -1.269803440396085, + -0.06688718485326725, + 0.5544021609832737, + -2.904293766981197, + 1.6866443742416257, + -1.6783511959093573, + 1.3081213916230614, ], ), ], @@ -325,7 +325,7 @@ def test_update_snapshot( assert sim_gen_kw != target_gen_kw # Check that posterior is as expected - assert target_gen_kw == pytest.approx(expected_gen_kw, rel=1e-5) + assert target_gen_kw == pytest.approx(expected_gen_kw, abs=1e-5) @pytest.mark.usefixtures("use_tmpdir")