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)) ]
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]))
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]))
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) ]
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))]
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)]