mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
feat!: Implemented improved first and second derivatives for the
corresponding methods of the Corr class. The parameter which distinguishes between the variant is now a string instead of a bool which may break current analyses.
This commit is contained in:
parent
fbb98e05f6
commit
8165479846
2 changed files with 75 additions and 30 deletions
|
@ -45,7 +45,7 @@ def test_modify_correlator():
|
|||
exponent = np.random.normal(3, 5)
|
||||
corr_content.append(pe.pseudo_Obs(2 + 10 ** exponent, 10 ** (exponent - 1), 't'))
|
||||
|
||||
corr = pe.correlators.Corr(corr_content)
|
||||
corr = pe.Corr(corr_content)
|
||||
|
||||
with pytest.warns(RuntimeWarning):
|
||||
corr.symmetric()
|
||||
|
@ -53,14 +53,26 @@ def test_modify_correlator():
|
|||
corr.anti_symmetric()
|
||||
|
||||
for pad in [0, 2]:
|
||||
corr = pe.correlators.Corr(corr_content, padding=[pad, pad])
|
||||
corr = pe.Corr(corr_content, padding=[pad, pad])
|
||||
corr.roll(np.random.randint(100))
|
||||
corr.deriv(symmetric=True)
|
||||
corr.deriv(symmetric=False)
|
||||
corr.deriv(variant="forward")
|
||||
corr.deriv(variant="symmetric")
|
||||
corr.deriv(variant="improved")
|
||||
corr.deriv().deriv()
|
||||
corr.second_deriv()
|
||||
corr.second_deriv(variant="symmetric")
|
||||
corr.second_deriv(variant="improved")
|
||||
corr.second_deriv().second_deriv()
|
||||
|
||||
for i, e in enumerate(corr.content):
|
||||
corr.content[i] = None
|
||||
|
||||
for func in [pe.Corr.deriv, pe.Corr.second_deriv]:
|
||||
for variant in ["symmetric", "improved", "forward", "gibberish", None]:
|
||||
with pytest.raises(Exception):
|
||||
func(corr, variant=variant)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_m_eff():
|
||||
for padding in [0, 4]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue