From 1eb6fc77a0e22d004c4cf0288d0e3eddd8fed192 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 29 Dec 2022 10:33:33 +0530 Subject: [PATCH] fix formatting and other issues --- python/gtsam/tests/test_HybridFactorGraph.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/python/gtsam/tests/test_HybridFactorGraph.py b/python/gtsam/tests/test_HybridFactorGraph.py index 576efa82f..37bb5b93c 100644 --- a/python/gtsam/tests/test_HybridFactorGraph.py +++ b/python/gtsam/tests/test_HybridFactorGraph.py @@ -10,21 +10,19 @@ Author: Fan Jiang """ # pylint: disable=invalid-name, no-name-in-module, no-member -from __future__ import print_function - import unittest -import gtsam import numpy as np from gtsam.symbol_shorthand import C, X from gtsam.utils.test_case import GtsamTestCase +import gtsam + class TestHybridGaussianFactorGraph(GtsamTestCase): """Unit tests for HybridGaussianFactorGraph.""" - def test_create(self): - """Test contruction of hybrid factor graph.""" + """Test construction of hybrid factor graph.""" noiseModel = gtsam.noiseModel.Unit.Create(3) dk = gtsam.DiscreteKeys() dk.push_back((C(0), 2)) @@ -45,7 +43,6 @@ class TestHybridGaussianFactorGraph(GtsamTestCase): gtsam.Ordering.ColamdConstrainedLastHybridGaussianFactorGraph( hfg, [C(0)])) - # print("hbn = ", hbn) self.assertEqual(hbn.size(), 2) mixture = hbn.at(0).inner() @@ -56,7 +53,7 @@ class TestHybridGaussianFactorGraph(GtsamTestCase): self.assertIsInstance(discrete_conditional, gtsam.DiscreteConditional) def test_optimize(self): - """Test contruction of hybrid factor graph.""" + """Test construction of hybrid factor graph.""" noiseModel = gtsam.noiseModel.Unit.Create(3) dk = gtsam.DiscreteKeys() dk.push_back((C(0), 2)) @@ -73,16 +70,16 @@ class TestHybridGaussianFactorGraph(GtsamTestCase): hfg.add(jf2) hfg.push_back(gmf) - dtf = gtsam.DecisionTreeFactor([(C(0), 2)],"0 1") + dtf = gtsam.DecisionTreeFactor([(C(0), 2)], "0 1") hfg.add(dtf) hbn = hfg.eliminateSequential( gtsam.Ordering.ColamdConstrainedLastHybridGaussianFactorGraph( hfg, [C(0)])) - # print("hbn = ", hbn) hv = hbn.optimize() self.assertEqual(hv.atDiscrete(C(0)), 1) + if __name__ == "__main__": unittest.main()