Created routine to get jsonstring itself, allowed for the I/O of uncompressed files, fixed bug for 1d-Arrays

This commit is contained in:
Simon Kuberski 2021-11-30 14:28:07 +01:00
parent 63dd627e20
commit d7c2f125fe
2 changed files with 68 additions and 19 deletions

View file

@ -14,9 +14,10 @@ def test_jsonio():
o5 = pe.pseudo_Obs(0.8, .1, 'two|r2')
testl = [o3, o5]
arr = np.array([o3, o5])
mat = np.array([[pe.pseudo_Obs(1.0, .1, 'mat'), pe.pseudo_Obs(0.3, .1, 'mat')], [pe.pseudo_Obs(0.2, .1, 'mat'), pe.pseudo_Obs(2.0, .4, 'mat')]])
ol = [do, testl, mat]
ol = [do, testl, mat, arr, np.array([o])]
fname = 'test_rw'
jsonio.dump_to_json(ol, fname, indent=1)
@ -32,5 +33,5 @@ def test_jsonio():
or1 = np.ravel(ol[i])
or2 = np.ravel(rl[i])
for j in range(len(or1)):
o = or1[i] - or2[i]
o = or1[j] - or2[j]
assert(o.is_zero())