Esempio n. 1
0
 def test_full(self):
     path = os.path.dirname(os.path.dirname(__file__))
     self.assertEqual(
         0,
         subprocess.check_call([
             os.path.join(path, "pycgtool.py"),
             "-g",
             "test/data/sugar.gro",
             "-x",
             "test/data/sugar.xtc",
             "-m",
             "test/data/sugar_only.map",
             "-b",
             "test/data/sugar.bnd",
         ],
                               stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE))
     self.assertTrue(
         cmp_whitespace_float("out.itp",
                              "test/data/sugar_out.itp",
                              float_rel_error=0.001))
     self.assertTrue(
         cmp_whitespace_float("out.gro",
                              "test/data/sugar_out.gro",
                              float_rel_error=0.001))
Esempio n. 2
0
 def test_full(self):
     path = os.path.dirname(os.path.dirname(__file__))
     self.assertEqual(0, subprocess.check_call([os.path.join(path, "pycgtool.py"),
                                                "-g", "test/data/sugar.gro",
                                                "-x", "test/data/sugar.xtc",
                                                "-m", "test/data/sugar_only.map",
                                                "-b", "test/data/sugar.bnd",
                                                ], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
     self.assertTrue(cmp_whitespace_float("out.itp", "test/data/sugar_out.itp", float_rel_error=0.001))
     self.assertTrue(cmp_whitespace_float("out.gro", "test/data/sugar_out.gro", float_rel_error=0.001))
Esempio n. 3
0
    def test_full_itp_sugar(self):
        measure = BondSet("test/data/sugar.bnd", DummyOptions)
        frame = Frame("test/data/sugar.gro", xtc="test/data/sugar.xtc")
        mapping = Mapping("test/data/sugar.map", DummyOptions)
        cgframe = mapping.apply(frame)

        while frame.next_frame():
            cgframe = mapping.apply(frame, cgframe=cgframe)
            measure.apply(cgframe)

        measure.boltzmann_invert()

        logging.disable(logging.WARNING)
        measure.write_itp("sugar_out.itp", mapping)
        logging.disable(logging.NOTSET)

        self.assertTrue(cmp_whitespace_float("sugar_out.itp", "test/data/sugar_out.itp", float_rel_error=0.001))
Esempio n. 4
0
    def test_full_itp_sugar(self):
        measure = BondSet("test/data/sugar.bnd", DummyOptions)
        frame = Frame("test/data/sugar.gro", xtc="test/data/sugar.xtc")
        mapping = Mapping("test/data/sugar.map", DummyOptions)
        cgframe = mapping.apply(frame)

        while frame.next_frame():
            cgframe = mapping.apply(frame, cgframe=cgframe)
            measure.apply(cgframe)

        measure.boltzmann_invert()

        logging.disable(logging.WARNING)
        measure.write_itp("sugar_out.itp", mapping)
        logging.disable(logging.NOTSET)

        self.assertTrue(
            cmp_whitespace_float("sugar_out.itp",
                                 "test/data/sugar_out.itp",
                                 float_rel_error=0.001))