From 7edc617e040b1e35bc99eb6f529b2d44bcb7a370 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 7 Apr 2022 16:09:37 +0100 Subject: [PATCH] tests: test for covariance of two obs with differently spaced idls added. --- tests/obs_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/obs_test.py b/tests/obs_test.py index f006bcef..1bb3f512 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -713,6 +713,17 @@ def test_covariance_rank_deficient(): with pytest.warns(RuntimeWarning): pe.covariance(obs) +def test_covariance_idl(): + range1 = range(10, 1010, 10) + range2 = range(10, 1010, 50) + + obs1 = pe.Obs([np.random.normal(1.0, 0.1, len(range1))], ["ens"], idl=[range1]) + obs2 = pe.Obs([np.random.normal(1.0, 0.1, len(range2))], ["ens"], idl=[range2]) + obs1.gamma_method() + obs2.gamma_method() + + pe.covariance([obs1, obs2]) + def test_empty_obs(): o = pe.Obs([np.random.rand(100)], ['test'])