Skip to content

Commit 2462d39

Browse files
authored
Merge pull request #56 from easyScience/HM_ref_support
Added support for _space_group.name_H-M_ref keyword in CIF files
2 parents b689195 + 48d187d commit 2462d39

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Diff for: src/diffpy/structure/parsers/p_cif.py

+1
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ def _parse_space_group_symop_operation_xyz(self, block):
472472
sg_nameHall = (block.get('_space_group_name_Hall', '') or
473473
block.get('_symmetry_space_group_name_Hall', ''))
474474
sg_nameHM = (block.get('_space_group_name_H-M_alt', '') or
475+
block.get('_space_group_name_H-M_ref', '') or
475476
block.get('_symmetry_space_group_name_H-M', ''))
476477
self.cif_sgname = (sg_nameHall or sg_nameHM or None)
477478
sgid = (block.get('_space_group_IT_number', '') or

Diff for: src/diffpy/structure/tests/testdata/Ni_ref.cif

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
data_2102245
2+
_cell_length_a 3.562
3+
_cell_length_b 3.562
4+
_cell_length_c 3.562
5+
_cell_angle_alpha 90.00000000
6+
_cell_angle_beta 90.00000000
7+
_cell_angle_gamma 90.00000000
8+
_space_group_name_H-M_ref 'F m -3 m'
9+
10+
11+
loop_
12+
_atom_site_label
13+
_atom_site_type_symbol
14+
_atom_site_fract_x
15+
_atom_site_fract_y
16+
_atom_site_fract_z
17+
_atom_site_occupancy
18+
_atom_site_adp_type
19+
_atom_site_U_iso_or_equiv
20+
Ni Ni 0.00000000 0.00000000 0.00000000 1.00000000 Uiso 0.025
21+

Diff for: src/diffpy/structure/tests/testp_cif.py

+9
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class TestP_cif(unittest.TestCase):
7171
graphiteciffile = datafile('graphite.cif')
7272
cdsebulkpdffitfile = datafile('CdSe_bulk.stru')
7373
teiciffile = datafile('TeI.cif')
74+
refciffile = datafile('Ni_ref.cif')
7475
places = 6
7576

7677

@@ -334,6 +335,14 @@ def test_spacegroup_anisotropy(self):
334335
self.assertTrue(all(stru.anisotropy))
335336
return
336337

338+
def test_spacegroup_ref(self):
339+
"verify space group reference"
340+
pfile = self.pfile
341+
pfile.parseFile(self.refciffile)
342+
sg = pfile.spacegroup
343+
self.assertEqual('Fm-3m', sg.short_name)
344+
345+
return
337346

338347
def test_adp_type_ani(self):
339348
"verify adp type override to anisotropic"

0 commit comments

Comments
 (0)