mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
tests: tests of json corr format extended
This commit is contained in:
parent
dc35690c3e
commit
01c3d02394
1 changed files with 6 additions and 0 deletions
|
@ -107,6 +107,9 @@ def test_json_corr_io():
|
||||||
recover = pe.input.json.load_json('corr')
|
recover = pe.input.json.load_json('corr')
|
||||||
os.remove('corr.json.gz')
|
os.remove('corr.json.gz')
|
||||||
assert np.all([o.is_zero() for o in [x for x in (my_corr - recover) if x is not None]])
|
assert np.all([o.is_zero() for o in [x for x in (my_corr - recover) if x is not None]])
|
||||||
|
for index, entry in enumerate(my_corr):
|
||||||
|
if entry is None:
|
||||||
|
assert recover[index] is None
|
||||||
assert my_corr.tag == recover.tag
|
assert my_corr.tag == recover.tag
|
||||||
assert my_corr.reweighted == recover.reweighted
|
assert my_corr.reweighted == recover.reweighted
|
||||||
|
|
||||||
|
@ -123,4 +126,7 @@ def test_json_corr_2d_io():
|
||||||
recover = pe.input.json.load_json('corr')
|
recover = pe.input.json.load_json('corr')
|
||||||
os.remove('corr.json.gz')
|
os.remove('corr.json.gz')
|
||||||
assert np.all([np.all([o.is_zero() for o in q]) for q in [x.ravel() for x in (my_corr - recover) if x is not None]])
|
assert np.all([np.all([o.is_zero() for o in q]) for q in [x.ravel() for x in (my_corr - recover) if x is not None]])
|
||||||
|
for index, entry in enumerate(my_corr):
|
||||||
|
if entry is None:
|
||||||
|
assert recover[index] is None
|
||||||
assert my_corr.tag == recover.tag
|
assert my_corr.tag == recover.tag
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue