diff --git a/pyerrors/covobs.py b/pyerrors/covobs.py index 49953983..64d9d6ec 100644 --- a/pyerrors/covobs.py +++ b/pyerrors/covobs.py @@ -42,7 +42,7 @@ class Covobs: def errsq(self): """ Return the variance (= square of the error) of the Covobs """ - return float(np.dot(np.transpose(self.grad), np.dot(self.cov, self.grad))) + return np.dot(np.transpose(self.grad), np.dot(self.cov, self.grad)).item() def _set_cov(self, cov): """ Set the covariance matrix of the covobs diff --git a/pyerrors/input/dobs.py b/pyerrors/input/dobs.py index 4757baae..b8b005ff 100644 --- a/pyerrors/input/dobs.py +++ b/pyerrors/input/dobs.py @@ -850,7 +850,7 @@ def create_dobs_string(obsl, name, spec='dobs v1.0', origin='', symbol=[], who=N for i in range(ncov): for o in obsl: if cname in o.covobs: - val = o.covobs[cname].grad[i] + val = o.covobs[cname].grad[i].item() if val != 0: ds += '%1.14e ' % (val) else: diff --git a/pyerrors/obs.py b/pyerrors/obs.py index e00a3241..66f137d5 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -1521,7 +1521,7 @@ def _covariance_element(obs1, obs2): if e_name not in obs2.cov_names: continue - dvalue += float(np.dot(np.transpose(obs1.covobs[e_name].grad), np.dot(obs1.covobs[e_name].cov, obs2.covobs[e_name].grad))) + dvalue += np.dot(np.transpose(obs1.covobs[e_name].grad), np.dot(obs1.covobs[e_name].cov, obs2.covobs[e_name].grad)).item() return dvalue