def _spgr(self) -> gemmi.SpaceGroup: if self.symmops: symm_ops = self.symmops else: symm_ops = self.symmops_from_spgr return gemmi.find_spacegroup_by_ops( gemmi.GroupOps([gemmi.Op(o) for o in symm_ops]))
def test_groupops(self): gops = gemmi.GroupOps([gemmi.Op(t) for t in ['x, y, z', 'x, -y, z+1/2', 'x+1/2, y+1/2, z', 'x+1/2, -y+1/2, z+1/2']]) self.assertEqual(gops.find_centering(), 'C') self.assertEqual(len(gops), 4) self.assertEqual(gemmi.find_spacegroup_by_ops(gops).hm, 'C 1 c 1')
def is_centrosymm(self) -> bool: """ Whether a structuere is centro symmetric or not. """ ops = gemmi.GroupOps([gemmi.Op(o) for o in self.symmops]) return ops.is_centric()