Skip to content

Commit 13fe260

Browse files
committed
Fix Uisotropy bug in the GeneratorSite class.
GeneratorSite did not set the Uisotropy attribute (bug introduced in be75a8f). Also fixes the simplepdftwophase.py example in srfit.
1 parent 727b723 commit 13fe260

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

diffpy/Structure/SymmetryUtilities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ def _findUSpace(self):
444444
mxcols = numpy.argmax(numpy.fabs(Usp6), axis=1)
445445
Usp6 /= Usp6[mxrows,mxcols].reshape(-1, 1)
446446
self.Uspace = numpy.tensordot(Usp6, self.Ucomponents, axes=(1, 0))
447+
self.Uisotropy = (len(self.Uspace) == 1)
447448
return
448449

449450
def _findUParameters(self):

diffpy/Structure/tests/TestSymmetryUtilities.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,17 @@ def test_corepos(self):
391391
self.assertTrue(sc.coremap[4] == range(4, 4+192))
392392
return
393393

394+
def test_Uisotropy(self):
395+
"""check isotropy value for ADP-s at specified sites.
396+
"""
397+
sg225 = GetSpaceGroup(225)
398+
corepos = [[0, 0, 0], [0.1, 0.13, 0.17]]
399+
eau = ExpandAsymmetricUnit(sg225, corepos)
400+
self.assertEqual([True, False], eau.Uisotropy)
401+
sc = SymmetryConstraints(sg225, eau.expandedpos)
402+
self.assertEqual(4 * [True] + 192 * [False], sc.Uisotropy)
403+
return
404+
394405
# def test__findConstraints(self):
395406
# """check SymmetryConstraints._findConstraints()
396407
# """

0 commit comments

Comments
 (0)