def test_single_atom_reflection_xy_plane(): mol = Molecule(atoms=['C'], coordinates=np.array([[0, 0, 1]])) mol.reflect('xy') assert np.allclose(mol.coordinates, [[0, 0, -1]]) mol.reflect('xy') assert np.allclose(mol.coordinates, [[0, 0, 1]]) mol.reflect('xy', translate=5) assert np.allclose(mol.coordinates, [[0, 0, -6]]) mol.reflect('xy', translate=5) assert np.allclose(mol.coordinates, [[0, 0, 1]])
def test_benzene_reflection_should_not_change_bonding(): mol = Molecule(read=benzene_xyz) mol.reflect('xy') mol.get_bonds() assert np.allclose(mol.bonds, benzene_bonds) mol.reflect('yz') mol.get_bonds() assert np.allclose(mol.bonds, benzene_bonds) mol.reflect('xz') mol.get_bonds() assert np.allclose(mol.bonds, benzene_bonds)
def test_benzene_reflection_yz_plane_should_change_x_axis_position(): mol = Molecule(read=benzene_xyz) mol.center([5, 0, 0]) mol.reflect('yz') assert np.allclose(mol.get_center(), [-5, 0, 0])
def test_benzene_reflection_xy_plane_should_not_change_orientation(): mol = Molecule(read=benzene_xyz) mol.reflect('xy') assert np.allclose(mol.coordinates, benzene_coors)