Skip to content

Commit eef86ce

Browse files
committed
BUG: accept Atom occupancy of np.int64 type
Problem: boost python has no implicit conversion numpy.int64 --> double. Solution: convert value to float.
1 parent 778b492 commit eef86ce

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/diffpy/srreal/structureconverters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _fetchDiffPyStructureData(adpt, stru):
142142
aa = AdapterAtom()
143143
for a0 in stru:
144144
aa.atomtype = a0.element
145-
aa.occupancy = a0.occupancy
145+
aa.occupancy = float(a0.occupancy)
146146
aa.anisotropy = a0.anisotropy
147147
# copy fractional coordinates
148148
aa.xyz_cartn = a0.xyz

src/diffpy/srreal/tests/teststructureadapter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def test_createStructureAdapterTypes(self):
6060
self.assertTrue(type(adpt3) is DiffPyStructureAtomicAdapter)
6161
return
6262

63-
@unittest.expectedFailure
6463
def test_createStructureAdapter_int64_occupancy(self):
6564
"""Check Structure conversion when occupany is of numpy.int64 type.
6665
"""

0 commit comments

Comments
 (0)