mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: import_json_string now correctly reconstructs obs from string, test
added
This commit is contained in:
parent
ca4548b105
commit
2ce73fb3f2
2 changed files with 19 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
import pyerrors.obs as pe
|
||||
import pyerrors as pe
|
||||
import pyerrors.input.json as jsonio
|
||||
import numpy as np
|
||||
import os
|
||||
|
@ -66,3 +66,10 @@ def test_jsonio():
|
|||
assert np.all(o == r)
|
||||
|
||||
assert(description == rl['description'])
|
||||
|
||||
|
||||
def test_json_string_reconstruction():
|
||||
my_obs = pe.Obs([np.random.rand(100)], ['name'])
|
||||
json_string = pe.input.json.create_json_string(my_obs)
|
||||
reconstructed_obs = pe.input.json.import_json_string(json_string)
|
||||
assert my_obs == reconstructed_obs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue