예제 #1
0
 def setUp(cls):
     """A method that is run before each unit test in this class"""
     spc = Species().from_smiles('CCO')
     log = GaussianLog(
         os.path.join(os.path.dirname(__file__), 'data', 'ethylene.log'))
     spc.conformer = log.load_conformer()[0]
     coords, numbers, masses = log.load_geometry()
     spc.conformer.coordinates = coords, 'angstroms'
     spc.conformer.number = numbers
     spc.conformer.mass = masses, 'amu'
     cls.thermo_job = ThermoJob(species=spc, thermo_class='NASA')
예제 #2
0
    def test_get_str_xyz(self):
        """Test generating an xyz string from the species.conformer object"""
        log = GaussianLog(
            os.path.join(os.path.dirname(__file__), 'data', 'ethylene_G3.log'))
        conformer = log.load_conformer()[0]
        coords, number, mass = log.load_geometry()
        conformer.coordinates, conformer.number, conformer.mass = (
            coords, "angstroms"), number, (mass, "amu")
        spc1 = Species(smiles='C=C')
        spc1.conformer = conformer
        xyz_str = get_str_xyz(spc1)
        expected_xyz_str = """C       0.00545100    0.00000000    0.00339700
H       0.00118700    0.00000000    1.08823200
H       0.97742900    0.00000000   -0.47841600
C      -1.12745800    0.00000000   -0.70256500
H      -1.12319800    0.00000000   -1.78740100
H      -2.09943900    0.00000000   -0.22075700"""
        self.assertEqual(xyz_str, expected_xyz_str)