mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: Bug in export of derivative of correlator containing covobs fixed,
test added.
This commit is contained in:
parent
7568275d5d
commit
471eabeb8c
2 changed files with 12 additions and 0 deletions
|
@ -171,6 +171,9 @@ def create_json_string(ol, description='', indent=1):
|
|||
names.append(key)
|
||||
idl.append(value)
|
||||
my_obs = Obs(samples, names, idl)
|
||||
my_obs._covobs = obs._covobs
|
||||
for name in obs._covobs:
|
||||
my_obs.names.append(name)
|
||||
my_obs.reweighted = obs.reweighted
|
||||
my_obs.is_merged = obs.is_merged
|
||||
return my_obs
|
||||
|
|
|
@ -242,3 +242,12 @@ def test_json_dict_io():
|
|||
jsonio.dump_dict_to_json(od, fname, description=desc)
|
||||
|
||||
os.remove(fname + '.json.gz')
|
||||
|
||||
|
||||
def test_renorm_deriv_of_corr(tmp_path):
|
||||
c = pe.Corr([pe.pseudo_Obs(i, .1, 'test') for i in range(10)])
|
||||
c *= pe.cov_Obs(1., .1, '#ren')
|
||||
c = c.deriv()
|
||||
pe.input.json.dump_to_json(c, (tmp_path / 'test').as_posix())
|
||||
recover = pe.input.json.load_json((tmp_path / 'test').as_posix())
|
||||
assert np.all([o == 0 for o in (c - recover)[1:-1]])
|
||||
|
|
Loading…
Add table
Reference in a new issue