Esempio n. 1
0
    def test_set_symmetry(self):
        sym = [68.7, 126.8, 184.0, 90.0, 90.0, 90.0, 'P 21 21 21']
        cmd.pseudoatom('m1')
        cmd.set_symmetry('m1', *sym)
        v = cmd.get_symmetry('m1')
        self.assertEqual(v[-1], sym[-1])
        self.assertArrayEqual(v[:-1], sym[:-1], 1e-4)

        cmd.pseudoatom('m2')
        cmd.symmetry_copy('m1', 'm2')
        v = cmd.get_symmetry('m2')
        self.assertEqual(v[-1], sym[-1])
        self.assertArrayEqual(v[:-1], sym[:-1], 1e-4)
Esempio n. 2
0
    def test_set_symmetry(self):
        sym = [68.7, 126.8, 184.0, 90.0, 90.0, 90.0, 'P 21 21 21']
        cmd.pseudoatom('m1')
        cmd.set_symmetry('m1', *sym)
        v = cmd.get_symmetry('m1')
        self.assertEqual(v[-1], sym[-1])
        self.assertArrayEqual(v[:-1], sym[:-1], 1e-4)

        cmd.pseudoatom('m2')
        cmd.symmetry_copy('m1', 'm2')
        v = cmd.get_symmetry('m2')
        self.assertEqual(v[-1], sym[-1])
        self.assertArrayEqual(v[:-1], sym[:-1], 1e-4)
    def __init__(self, map_name, level, radius, name, sym_source):
        self.level = level
        self.radius = radius
        self.map_name = map_name
        self.name = name
        self.center_name = cmd.get_unused_name('_center')
        self.callback_name = cmd.get_unused_name('_cb')

        cmd.set("auto_zoom", 0)
        cmd.pseudoatom(self.center_name)
        cmd.hide("everything", self.center_name)

        symmetry = cmd.get_symmetry(sym_source or map_name)
        if symmetry:
            cmd.set("map_auto_expand_sym", 1)
            cmd.set_symmetry(self.center_name, *symmetry)

        cmd.set_key("pgup", self.contour_plus)
        cmd.set_key("pgdn", self.contour_minus)

        self.update()
    def __init__(self, map_name, level, radius, name, sym_source):
        self.level = level
        self.radius = radius
        self.map_name = map_name
        self.name = name
        self.center_name = cmd.get_unused_name('_center')
        self.callback_name = cmd.get_unused_name('_cb')

        cmd.set("auto_zoom", 0)
        cmd.pseudoatom(self.center_name)
        cmd.hide("everything", self.center_name)

        symmetry = cmd.get_symmetry(sym_source or map_name)
        if symmetry:
            cmd.set("map_auto_expand_sym", 1)
            cmd.set_symmetry(self.center_name, *symmetry)

        cmd.set_key("pgup", self.contour_plus)
        cmd.set_key("pgdn", self.contour_minus)

        self.update()