From dce7d4bec825c294a184c970684dc2c19ff47e5d Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 18 Feb 2022 09:16:29 +0000 Subject: [PATCH] tests: test for corr matrix initialization with none entries added. --- tests/correlators_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 550e2a5b..27dc0f67 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -296,3 +296,18 @@ def test_thin(): thin.fit(lambda a, x: a[0] * x) c.thin(offset=1) c.thin(3, offset=1) + + +def test_corr_matrix_none_entries(): + dim = 8 + x = np.arange(dim) + y = 2 * np.exp(-0.06 * x) + np.random.normal(0.0, 0.15, dim) + yerr = [0.1] * dim + + oy = [] + for i, item in enumerate(x): + oy.append(pe.pseudo_Obs(y[i], yerr[i], 'test')) + + corr = pe.Corr(oy) + corr = corr.deriv() + pe.Corr(np.array([[corr, corr], [corr, corr]]))