From 96b6895a600632de596d7b9bd1b8a7b18c6f3711 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 30 Dec 2022 13:59:59 -0500 Subject: [PATCH] Ratios now work out! --- python/gtsam/tests/test_HybridFactorGraph.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/gtsam/tests/test_HybridFactorGraph.py b/python/gtsam/tests/test_HybridFactorGraph.py index 77a0e8173..5668a8546 100644 --- a/python/gtsam/tests/test_HybridFactorGraph.py +++ b/python/gtsam/tests/test_HybridFactorGraph.py @@ -114,7 +114,7 @@ class TestHybridGaussianFactorGraph(GtsamTestCase): bayesNet.addGaussian(prior_on_x0) # Add prior on mode. - bayesNet.emplaceDiscrete(mode, "1/1") + bayesNet.emplaceDiscrete(mode, "6/4") return bayesNet @@ -216,10 +216,10 @@ class TestHybridGaussianFactorGraph(GtsamTestCase): for i in range(10): other = bayesNet.sample() other.update(measurements) - # print(other) ratio = self.calculate_ratio(bayesNet, fg, other) # print(f"Ratio: {ratio}\n") - # self.assertAlmostEqual(ratio, expected_ratio) + if (ratio > 0): + self.assertAlmostEqual(ratio, expected_ratio) if __name__ == "__main__":