mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
54bab990e1
2 changed files with 128 additions and 27 deletions
|
@ -13,10 +13,16 @@ def test_jsonio():
|
|||
otag = 'This has been merged!'
|
||||
o4.tag = otag
|
||||
do = o - .2 * o4
|
||||
co1 = pe.cov_Obs(1., .123, 'cov1')
|
||||
co3 = pe.cov_Obs(4., .1 ** 2, 'cov3')
|
||||
do *= co1 / co3
|
||||
do.tag = {'A': 2}
|
||||
|
||||
o5 = pe.pseudo_Obs(0.8, .1, 'two|r2')
|
||||
o5.tag = 2*otag
|
||||
co2 = pe.cov_Obs([1, 2], [[.12, .004], [.004, .02]], 'cov2')
|
||||
o5 /= co2[0]
|
||||
o3 /= co2[1]
|
||||
o5.tag = 2 * otag
|
||||
testl = [o3, o5]
|
||||
|
||||
arr = np.array([o3, o5])
|
||||
|
@ -33,7 +39,7 @@ def test_jsonio():
|
|||
|
||||
tt.tag = 'Test Obs: Ä'
|
||||
|
||||
ol = [o4, do, testl, mat, arr, np.array([o]), np.array([tt, tt]), [tt, tt]]
|
||||
ol = [o4, do, testl, mat, arr, np.array([o]), np.array([tt, tt]), [tt, tt], co1, co2, np.array(co2), co1 / co2[0]]
|
||||
fname = 'test_rw'
|
||||
|
||||
jsonio.dump_to_json(ol, fname, indent=1, description='[I am a tricky description]')
|
||||
|
@ -45,7 +51,7 @@ def test_jsonio():
|
|||
for o, r in zip(ol, rl):
|
||||
assert np.all(o == r)
|
||||
|
||||
for i in range(len(rl)):
|
||||
for i in range(len(ol)):
|
||||
if isinstance(ol[i], pe.Obs):
|
||||
o = ol[i] - rl[i]
|
||||
assert(o.is_zero())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue