def test_set_cov(self): p = JointNormal(labels=['x', 'y'], mu=np.array([0, 0]), cov=np.array([[1e-19, 1e-19], [1e-19, 1e-19]])) p.cov = self.cov self.assertAlmostEqual(p.cov[0, 0], self.cov[0, 0]) self.assertAlmostEqual(p.cov[1, 1], self.cov[1, 1])
def test_set_cov_bad(self): p = JointNormal(labels=['x', 'y'], mu=np.array([0, 0]), cov=np.array([[1e-19, 1e-19], [1e-19, 1e-19]])) with self.assertRaises(ValueError): p.cov = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]