utf-8 for plain json files and a bugfix for reading arrays

This commit is contained in:
Simon Kuberski 2021-11-30 16:26:46 +01:00
parent 5937a519d7
commit d740f8d3c4
2 changed files with 15 additions and 11 deletions

View file

@ -19,7 +19,15 @@ def test_jsonio():
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 = [o4, do, testl, mat, arr, np.array([o])]
tt1 = pe.Obs([np.random.rand(100)], ['t|r1'], idl=[range(2, 202, 2)])
tt2 = pe.Obs([np.random.rand(100)], ['t|r2'], idl=[range(2, 202, 2)])
tt3 = pe.Obs([np.random.rand(102)], ['qe'])
tt = tt1 + tt2 + tt3
tt.tag = 'Test Obs'
ol = [o4, do, testl, mat, arr, np.array([o]), np.array([tt, tt]), [tt, tt]]
fname = 'test_rw'
jsonio.dump_to_json(ol, fname, indent=1)