refactor: instantiation of Obs in import_jackknife slightly optimized

This commit is contained in:
Fabian Joswig 2022-02-28 13:25:09 +00:00
parent 2ba59f90c0
commit 0f749fd107

View file

@ -1470,7 +1470,8 @@ def import_jackknife(jacks, name, idl=None):
length = len(jacks) - 1
prj = (np.ones((length, length)) - (length - 1) * np.identity(length))
samples = jacks[1:] @ prj
new_obs = Obs([samples], [name], idl=idl)
mean = np.mean(samples)
new_obs = Obs([samples - mean], [name], idl=idl, means=[mean])
new_obs._value = jacks[0]
return new_obs