mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
feat: sorted_list argument readded to Corr.GEVP with a deprecation
warning.
This commit is contained in:
parent
eb8090a90c
commit
2136958fbc
2 changed files with 8 additions and 1 deletions
|
@ -241,7 +241,7 @@ class Corr:
|
|||
if self.N == 1:
|
||||
raise Exception("Trying to symmetrize a correlator matrix, that already has N=1.")
|
||||
|
||||
def GEVP(self, t0, ts=None, sort="Eigenvalue"):
|
||||
def GEVP(self, t0, ts=None, sort="Eigenvalue", **kwargs):
|
||||
"""Solve the generalized eigenvalue problem on the current correlator and returns the corresponding eigenvectors.
|
||||
|
||||
Parameters
|
||||
|
@ -261,6 +261,10 @@ class Corr:
|
|||
if self.N == 1:
|
||||
raise Exception("GEVP methods only works on correlator matrices and not single correlators.")
|
||||
|
||||
if "sorted_list" in kwargs:
|
||||
sort = kwargs.get("sorted_list")
|
||||
warnings.warn("Argument 'sorted_list' is deprecated, use 'sort' instead.", DeprecationWarning)
|
||||
|
||||
symmetric_corr = self.matrix_symmetric()
|
||||
if sort is None:
|
||||
if (ts is None):
|
||||
|
|
|
@ -245,6 +245,9 @@ def test_matrix_corr():
|
|||
with pytest.warns(RuntimeWarning):
|
||||
corr_mat.GEVP(0, 1, sort="Eigenvalue")
|
||||
|
||||
with pytest.warns(DeprecationWarning):
|
||||
corr_mat.GEVP(0, sorted_list="Eigenvalue")
|
||||
|
||||
with pytest.raises(Exception):
|
||||
corr_mat.GEVP(0, 1, sort="This sorting method does not exist.")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue