Skip to content

Commit 75c9568

Browse files
committed
TST: cover processing of CIF-defined space group
Test this on dummy CIF file with non-standard SG.
1 parent 2d73167 commit 75c9568

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
data_9008569
2+
_chemical_name 'Graphite'
3+
loop_
4+
_publ_author_name
5+
'Wyckoff R W G'
6+
_journal_name_full "Crystal Structures"
7+
_journal_volume 1
8+
_journal_year 1963
9+
_journal_page_first 7
10+
_journal_page_last 83
11+
_publ_section_title
12+
;
13+
Second edition. Interscience Publishers, New York, New York
14+
;
15+
_chemical_formula_sum 'C'
16+
_cell_length_a 2.456
17+
_cell_length_b 2.456
18+
_cell_length_c 6.696
19+
_cell_angle_alpha 90
20+
_cell_angle_beta 90
21+
_cell_angle_gamma 120
22+
_cell_volume 34.979
23+
# _symmetry_space_group_name_H-M 'P 63 m c'
24+
loop_
25+
_symmetry_equiv_pos_as_xyz
26+
'x,y,z'
27+
'-x,-x+y,1/2+z'
28+
'x-y,x,1/2+z'
29+
'-y,-x,z'
30+
'-y,x-y,z'
31+
'x-y,-y,1/2+z'
32+
# '-x,-y,1/2+z'
33+
# 'x,x-y,z'
34+
# '-x+y,-x,z'
35+
# 'y,x,1/2+z'
36+
# 'y,-x+y,1/2+z'
37+
# '-x+y,y,z'
38+
loop_
39+
_atom_site_label
40+
_atom_site_fract_x
41+
_atom_site_fract_y
42+
_atom_site_fract_z
43+
C1 0.00000 0.00000 0.00000
44+
C2 0.33333 0.66667 0.00000

src/diffpy/structure/tests/testp_cif.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ def test_badspacegroup_cif(self):
277277
return
278278

279279

280+
def test_custom_spacegroup_cif(self):
281+
"""Test parsing of nonstandard symops-defined space group.
282+
"""
283+
pfile = self.pfile
284+
filename = datafile('customsg.cif')
285+
pfile.parseFile(filename)
286+
sg = pfile.spacegroup
287+
self.assertEqual('CIF data', sg.short_name)
288+
self.assertEqual(6, len(sg.symop_list))
289+
return
290+
291+
280292
def test_getParser(self):
281293
"""Test passing of eps keyword argument by getParser function.
282294
"""

0 commit comments

Comments
 (0)