Beispiel #1
0
    def test_read_comment(self):

        with open(self.expected_comment_file) as f:
            expected_comment = f.next()

        with gro.open(self.test_file_name, decimals=self.decimals) as f:
            f.next()            # read a geometry to get its comment
            self.assertEqual(f.comment, expected_comment)
Beispiel #2
0
    def test_read_crd(self):
        with open(self.expected_crds_file) as f:
            expected_crds = 10. * np.array([float(x) for x in f.read().split()])

        with gro.open(self.test_file_name, decimals=self.decimals) as f:
            crds = f.next()

        for (expected, crd) in it.izip_longest(expected_crds, crds):
            self.assertAlmostEqual(expected, crd, self.decimals)