Merge branch 'develop' into documentation

This commit is contained in:
fjosw 2021-12-01 15:00:09 +00:00
commit a6abdb87b1
2 changed files with 7 additions and 1 deletions

View file

@ -459,7 +459,7 @@ class Obs:
atol : float atol : float
Absolute tolerance (for details see numpy documentation). Absolute tolerance (for details see numpy documentation).
""" """
return (np.isclose(0.0, self.value, rtol, atol) and all(np.allclose(0.0, delta, rtol, atol) for delta in self.deltas.values()) and all(np.allclose(0.0, delta.grad, rtol, atol) for delta in self.covobs.values())) return np.isclose(0.0, self.value, rtol, atol) and all(np.allclose(0.0, delta, rtol, atol) for delta in self.deltas.values()) and all(np.allclose(0.0, delta.errsq(), rtol, atol) for delta in self.covobs.values())
def plot_tauint(self, save=None): def plot_tauint(self, save=None):
"""Plot integrated autocorrelation time for each ensemble. """Plot integrated autocorrelation time for each ensemble.

View file

@ -581,3 +581,9 @@ def test_covobs():
do = cl[0] * cl[1] do = cl[0] * cl[1]
assert(np.array_equal(do.covobs['rAP'].grad, np.transpose([pi[1], pi[0]]).reshape(2, 1))) assert(np.array_equal(do.covobs['rAP'].grad, np.transpose([pi[1], pi[0]]).reshape(2, 1)))
def test_covobs_overloading():
covobs = pe.cov_Obs([0.5, 0.5], np.array([[0.02, 0.02], [0.02, 0.02]]), 'Zfactor')
assert (covobs[0] / covobs[1]) == 1
assert (covobs[0] - covobs[1]) == 0