mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
__eq__ method for Corr class (#206)
* feat: implemented __eq__ method for Corr class. * feat: __eq__ method now respects None entries in correlators. * feat: Obs can now be compared to None, __ne__ method removed as it is not required. * feat: Corr.__eq__ rewritten to give a per element comparison. * tests: additional test case for correlator comparison added. * feat: comparison now also works for padding.
This commit is contained in:
parent
1e438356fd
commit
af28f77ec5
4 changed files with 46 additions and 3 deletions
|
@ -103,6 +103,7 @@ def test_comparison():
|
|||
test_obs1 = pe.pseudo_Obs(value1, 0.1, 't')
|
||||
value2 = np.random.normal(0, 100)
|
||||
test_obs2 = pe.pseudo_Obs(value2, 0.1, 't')
|
||||
assert test_obs1 != None
|
||||
assert (value1 > value2) == (test_obs1 > test_obs2)
|
||||
assert (value1 < value2) == (test_obs1 < test_obs2)
|
||||
assert (value1 >= value2) == (test_obs1 >= test_obs2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue