From e310860625e56f8daad713991ef56f35ef04d400 Mon Sep 17 00:00:00 2001 From: Feda Curic Date: Tue, 5 Nov 2024 10:24:16 +0100 Subject: [PATCH] Transpose before calculating covariance in test np.cov expects rows to be parameters and columns to be realizations --- tests/ert/ui_tests/cli/test_field_parameter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ert/ui_tests/cli/test_field_parameter.py b/tests/ert/ui_tests/cli/test_field_parameter.py index 2a346b6989a..ca8a5f076a7 100644 --- a/tests/ert/ui_tests/cli/test_field_parameter.py +++ b/tests/ert/ui_tests/cli/test_field_parameter.py @@ -33,13 +33,15 @@ def test_field_param_update_using_heat_equation(heat_equation_storage): prior_covariance = np.cov( prior_result.values.reshape( prior.ensemble_size, param_config.nx * param_config.ny * param_config.nz - ) + ), + rowvar=False, ) posterior_covariance = np.cov( posterior_result.values.reshape( posterior.ensemble_size, param_config.nx * param_config.ny * param_config.nz, - ) + ), + rowvar=False, ) # Check that generalized variance is reduced by update step. assert np.trace(prior_covariance) > np.trace(posterior_covariance)