From 79ff0f7073111929033837233903fc32c286f526 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 12 Oct 2016 18:20:43 -0700 Subject: [PATCH] Squashed 'modules/pmi/' changes from d2651da..026f119 026f119 Use assertAlmostEqual to compare float values. 30a441b Speed up test by using a smaller system. git-subtree-dir: modules/pmi git-subtree-split: 026f119f77a2288ae88012b8ff1703bb5e475a05 --- modules/pmi/test/test_em_fit.py | 14 +++++++------- modules/pmi/test/test_transform_mover.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/pmi/test/test_em_fit.py b/modules/pmi/test/test_em_fit.py index fd24c35012..9c5cbf0ee2 100644 --- a/modules/pmi/test/test_em_fit.py +++ b/modules/pmi/test/test_em_fit.py @@ -59,19 +59,19 @@ def test_gaussian_em(self): p = gem.target_ps[0] pos = IMP.core.XYZ(p).get_coordinates() - self.assertEqual(pos[0], -6.50710525063) - self.assertEqual(pos[1], -44.7706839578) - self.assertEqual(pos[2], -70.33819299) + self.assertAlmostEqual(pos[0], -6.50710525063, delta=1e-6) + self.assertAlmostEqual(pos[1], -44.7706839578, delta=1e-6) + self.assertAlmostEqual(pos[2], -70.33819299, delta=1e-6) gem.center_target_density_on_model() pos = IMP.core.XYZ(p).get_coordinates() - self.assertNotEqual(pos[0], -6.50710525063) + self.assertNotAlmostEqual(pos[0], -6.50710525063, delta=1e-6) gem.center_target_density_on_origin() pos = IMP.core.XYZ(p).get_coordinates() - self.assertEqual(pos[0], 0) - self.assertEqual(pos[1], 0) - self.assertEqual(pos[2], 0) + self.assertAlmostEqual(pos[0], 0, delta=1e-6) + self.assertAlmostEqual(pos[1], 0, delta=1e-6) + self.assertAlmostEqual(pos[2], 0, delta=1e-6) def test_add_em_gmms_to_hierarchy(self): """Test adding EM Restraint GMMs to PMI2 Hierarchies and RMF""" diff --git a/modules/pmi/test/test_transform_mover.py b/modules/pmi/test/test_transform_mover.py index ae3422bda4..b671056946 100644 --- a/modules/pmi/test/test_transform_mover.py +++ b/modules/pmi/test/test_transform_mover.py @@ -359,7 +359,7 @@ def test_pmi_representation_sampling_mainchain_mover(self): - domains=[("A", "A.1", 0.10, fastafile, "1WCM:A", "BEADS", None, (1,100,0), None, 1, None, None, None, None, None, None)] + domains=[("A", "A.1", 0.10, fastafile, "1WCM:A", "BEADS", None, (1,50,0), None, 1, None, None, None, None, None, None)] with IMP.allow_deprecated(): bm=IMP.pmi.macros.BuildModel1(simo)