From f45b0aa6ecb9067323fde164630e02470b754e55 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 18 May 2022 10:54:09 +0100 Subject: [PATCH] tests: coverage of Corr class improved. --- tests/correlators_test.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 90dac90a..97bbebb1 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -229,6 +229,7 @@ def test_matrix_corr(): corr_ab = 0.5 * corr_aa corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]])) + corr_mat.gamma_method() corr_mat.item(0, 0) for (ts, sort) in zip([None, 1, 1], ["Eigenvalue", "Eigenvector", None]): @@ -241,6 +242,8 @@ def test_matrix_corr(): assert np.all([o == 0 for o in corr_1 - corr_aa]) corr_mat.matrix_symmetric() + corr_mat.GEVP(0, state=0) + corr_mat.Eigenvalue(2, state=0) def test_GEVP_warnings(): @@ -263,9 +266,21 @@ def test_GEVP_exceptions(): corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]])) corr_mat.item(0, 0) + with pytest.raises(Exception): + corr_mat.item(0, 0).projected() + + with pytest.raises(Exception): + corr_mat.item(0, 0).GEVP(2) + + with pytest.raises(Exception): + corr_mat.item(0, 0).matrix_symmetric() + with pytest.raises(Exception): corr_mat.GEVP(0, 0, sort=None) + with pytest.raises(Exception): + corr_mat.GEVP(0, sort=None) + with pytest.raises(Exception): corr_mat.GEVP(1, 0, sort="Eigenvector") @@ -275,6 +290,9 @@ def test_GEVP_exceptions(): with pytest.raises(Exception): corr_mat.plottable() + with pytest.raises(Exception): + corr_mat.spaghetti_plot() + with pytest.raises(Exception): corr_mat.show() @@ -282,7 +300,7 @@ def test_GEVP_exceptions(): corr_mat.m_eff() with pytest.raises(Exception): - corr_mat.Hankel() + corr_mat.Hankel(2) with pytest.raises(Exception): corr_mat.plateau()