Exemplo n.º 1
0
    def isSpaceGroupPossible(self, spacegroup):
        """Check if space group is consistent with lattice parameters.

        spacegroup -- instance of SpaceGroup

        Return bool.
        """
        from diffpy.Structure.SymmetryUtilities import isSpaceGroupLatPar
        return isSpaceGroupLatPar(spacegroup, *self.initial.lattice.abcABG())
Exemplo n.º 2
0
    def isSpaceGroupPossible(self, spacegroup):
        """Check if space group is consistent with lattice parameters.

        spacegroup -- instance of SpaceGroup

        Return bool.
        """
        from diffpy.Structure.SymmetryUtilities import isSpaceGroupLatPar
        return isSpaceGroupLatPar(spacegroup, *self.initial.lattice.abcABG())
 def test_isSpaceGroupLatPar(self):
     """check isSpaceGroupLatPar()
     """
     triclinic = GetSpaceGroup("P1")
     monoclinic = GetSpaceGroup("P2")
     orthorhombic = GetSpaceGroup("P222")
     tetragonal = GetSpaceGroup("P4")
     trigonal = GetSpaceGroup("P3")
     hexagonal = GetSpaceGroup("P6")
     cubic = GetSpaceGroup("P23")
     self.assertTrue(isSpaceGroupLatPar(triclinic, 1, 2, 3, 40, 50, 60))
     self.assertFalse(isSpaceGroupLatPar(monoclinic, 1, 2, 3, 40, 50, 60))
     self.assertTrue(isSpaceGroupLatPar(monoclinic, 1, 2, 3, 90, 50, 90))
     self.assertFalse(isSpaceGroupLatPar(orthorhombic, 1, 2, 3, 90, 50, 90))
     self.assertTrue(isSpaceGroupLatPar(orthorhombic, 1, 2, 3, 90, 90, 90))
     self.assertFalse(isSpaceGroupLatPar(tetragonal, 1, 2, 3, 90, 90, 90))
     self.assertTrue(isSpaceGroupLatPar(tetragonal, 2, 2, 3, 90, 90, 90))
     self.assertFalse(isSpaceGroupLatPar(trigonal, 2, 2, 3, 90, 90, 90))
     self.assertTrue(isSpaceGroupLatPar(trigonal, 2, 2, 2, 80, 80, 80))
     self.assertFalse(isSpaceGroupLatPar(hexagonal, 2, 2, 2, 80, 80, 80))
     self.assertTrue(isSpaceGroupLatPar(hexagonal, 2, 2, 3, 90, 90, 120))
     self.assertFalse(isSpaceGroupLatPar(cubic, 2, 2, 3, 90, 90, 120))
     self.assertTrue(isSpaceGroupLatPar(cubic, 3, 3, 3, 90, 90, 90))
     return
Exemplo n.º 4
0
 def test_isSpaceGroupLatPar(self):
     """check isSpaceGroupLatPar()
     """
     triclinic = GetSpaceGroup("P1")
     monoclinic = GetSpaceGroup("P2")
     orthorhombic = GetSpaceGroup("P222")
     tetragonal = GetSpaceGroup("P4")
     trigonal = GetSpaceGroup("P3")
     hexagonal = GetSpaceGroup("P6")
     cubic = GetSpaceGroup("P23")
     self.assertTrue(isSpaceGroupLatPar(triclinic, 1, 2, 3, 40, 50, 60))
     self.assertFalse(isSpaceGroupLatPar(monoclinic, 1, 2, 3, 40, 50, 60))
     self.assertTrue(isSpaceGroupLatPar(monoclinic, 1, 2, 3, 90, 50, 90))
     self.assertFalse(isSpaceGroupLatPar(orthorhombic, 1, 2, 3, 90, 50, 90))
     self.assertTrue(isSpaceGroupLatPar(orthorhombic, 1, 2, 3, 90, 90, 90))
     self.assertFalse(isSpaceGroupLatPar(tetragonal, 1, 2, 3, 90, 90, 90))
     self.assertTrue(isSpaceGroupLatPar(tetragonal, 2, 2, 3, 90, 90, 90))
     self.assertFalse(isSpaceGroupLatPar(trigonal, 2, 2, 3, 90, 90, 90))
     self.assertTrue(isSpaceGroupLatPar(trigonal, 2, 2, 2, 80, 80, 80))
     self.assertFalse(isSpaceGroupLatPar(hexagonal, 2, 2, 2, 80, 80, 80))
     self.assertTrue(isSpaceGroupLatPar(hexagonal, 2, 2, 3, 90, 90, 120))
     self.assertFalse(isSpaceGroupLatPar(cubic, 2, 2, 3, 90, 90, 120))
     self.assertTrue(isSpaceGroupLatPar(cubic, 3, 3, 3, 90, 90, 90))
     return