Skip to content

Commit 17aaf13

Browse files
committed
TST: check that unknown occupancy defaults to 1
Some CIF files may give "?", i.e., unknown occupancy.
1 parent f991b95 commit 17aaf13

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
data_TeI
2+
_audit_creation_date 2011-02-15
3+
4+
_symmetry_space_group_name_H-M 'C 1 2/m 1'
5+
6+
_cell_length_a 15.383
7+
_cell_length_b 4.182
8+
_cell_length_c 11.999
9+
_cell_angle_alpha 90
10+
_cell_angle_beta 128.09
11+
_cell_angle_gamma 90
12+
13+
loop_
14+
_atom_site_label
15+
_atom_site_type_symbol
16+
_atom_site_fract_x
17+
_atom_site_fract_y
18+
_atom_site_fract_z
19+
_atom_site_U_iso_or_equiv
20+
_atom_site_adp_type
21+
_atom_site_occupancy
22+
Te1 Te1+ 0.306590 0.000000 0.185920 0.019227 Uani ?
23+
Te2 Te1+ 0.429170 0.500000 0.168170 0.019784 Uani ?
24+
I1 I1- 0.153740 0.500000 0.182510 0.024813 Uani ?
25+
I2 I1- 0.610730 0.500000 0.448390 0.026878 Uani ?
26+
loop_
27+
_atom_site_aniso_label
28+
_atom_site_aniso_U_11
29+
_atom_site_aniso_U_22
30+
_atom_site_aniso_U_33
31+
_atom_site_aniso_U_12
32+
_atom_site_aniso_U_13
33+
_atom_site_aniso_U_23
34+
Te1 0.021100 0.019500 0.016000 0.000000 0.010900 0.000000
35+
Te2 0.022300 0.018000 0.025400 0.000000 0.017900 0.000000
36+
I1 0.025000 0.023400 0.034500 0.000000 0.022600 0.000000
37+
I2 0.023400 0.029500 0.025300 0.000000 0.013800 0.000000

src/diffpy/structure/tests/testp_cif.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ def test_eps(self):
249249
return
250250

251251

252+
def test_unknown_occupancy(self):
253+
"test CIF file with unknown occupancy data"
254+
stru = self.ptest.parseFile(datafile('TeI-unkocc.cif'))
255+
self.assertTrue(numpy.array_equal(16 * [1], stru.occupancy))
256+
return
257+
258+
252259
def test_nosites_cif(self):
253260
"""Test reading of CIF file with no valid sites.
254261
"""

0 commit comments

Comments
 (0)