Beispiel #1
0
 def test_port_init_shift(self, ethane):
     mb.translate_to(ethane, np.ones(3))
     separation = [1, 2, 3]
     port = mb.Port(anchor=ethane, separation=separation)
     assert [
         ethane.center[i] + separation[i] == coord
         for i, (coord, sep) in enumerate(zip(port.center, separation))
     ]
Beispiel #2
0
    def __init__(self):
        super(Ester, self).__init__()

        mb.load('ester.pdb', compound=self, relative_to_module=self.__module__)
        mb.translate(self, -self[0].pos)

        self.add(mb.Port(anchor=self[2]), 'up')
        mb.rotate_around_z(self['up'], np.pi / 2)
        mb.translate_to(self['up'], self[2].pos + np.array([0.07, 0, 0]))

        self.add(mb.Port(anchor=self[0]), 'down')
        mb.rotate_around_z(self['down'], np.pi / 2)
        mb.translate(self['down'], np.array([-0.07, 0, 0]))
Beispiel #3
0
    def __init__(self):
        super(Ester, self).__init__()

        mb.load('ester.pdb', compound=self, relative_to_module=self.__module__)
        mb.translate(self, -self[0].pos)

        self.add(mb.Port(anchor=self[2]), 'up')
        mb.spin_z(self['up'], np.pi / 2)
        mb.translate_to(self['up'], np.array([0.07, 0, 0]))

        self.add(mb.Port(anchor=self[0]), 'down')
        mb.spin_z(self['down'], np.pi / 2)
        mb.translate(self['down'], np.array([-0.07, 0, 0]))
Beispiel #4
0
 def test_port_init_shift_0(self, ethane):
     mb.translate_to(ethane, np.ones(3))
     port = mb.Port(anchor=ethane, separation=0)
     assert [
         ethane.center[i] == coord for i, coord in enumerate(port.center)
     ]
Beispiel #5
0
 def test_port_init_shift(self, ethane):
     mb.translate_to(ethane, np.ones(3))
     separation = [1, 2, 3]
     port = mb.Port(anchor=ethane, separation=separation)
     assert [ethane.center[i]+separation[i]==coord 
             for i, (coord, sep) in enumerate(zip(port.center, separation))]
Beispiel #6
0
 def test_port_init_shift_0(self, ethane):
     mb.translate_to(ethane, np.ones(3))
     port = mb.Port(anchor=ethane, separation=0)
     assert [ethane.center[i]==coord for i,coord in enumerate(port.center)]