Skip to content

Commit 093ed48

Browse files
committed
Test P_cif.eps resolution for parsing CIF files.
This closes #8.
1 parent 28a47c3 commit 093ed48

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

diffpy/Structure/tests/TestP_cif.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,21 @@ def test_write_and_read(self):
217217
self.assertAlmostEqual(0.046164, a3.U[2,2])
218218
return
219219

220+
def test_eps(self):
221+
"""Test the P_cif.eps coordinates resolution.
222+
"""
223+
pcif = P_cif()
224+
pcif.eps = 1e-8
225+
grph = pcif.parseFile(self.graphiteciffile)
226+
self.assertEqual(8, len(grph))
227+
self.assertTrue(all(a.label.startswith('C1') for a in grph[:2]))
228+
self.assertTrue(all(a.label.startswith('C2') for a in grph[2:]))
229+
pcif2 = P_cif()
230+
pcif2.eps = 1e-3
231+
grph2 = pcif2.parseFile(self.graphiteciffile)
232+
self.assertEqual(4, len(grph2))
233+
return
234+
220235
########################################################################
221236
# helpers
222237
########################################################################

0 commit comments

Comments
 (0)