def test_loading_different_versions_of_yaml(self): """Test loading a YAML file generated by RMG v 2.4.1 and by a more recent version""" arkane_spc_v_241 = ArkaneSpecies.__new__(ArkaneSpecies) arkane_spc_v_241.load_yaml( path=os.path.join(self.data_path, 'vinoxy_v_2.4.1.yml')) self.assertIsInstance(arkane_spc_v_241, ArkaneSpecies) # checks make_object self.assertEqual(arkane_spc_v_241.conformer.spin_multiplicity, 2) arkane_current = ArkaneSpecies.__new__(ArkaneSpecies) arkane_current.load_yaml( path=os.path.join(self.data_path, 'vinoxy_current.yml')) self.assertIsInstance(arkane_current, ArkaneSpecies) # checks make_object self.assertEqual(arkane_current.conformer.spin_multiplicity, 2)
def test_load_existing_yaml(self): """ Test that existing Arkane YAML files can still be loaded """ # Load in YAML file arkane_spc = ArkaneSpecies.__new__(ArkaneSpecies) arkane_spc.load_yaml(path=os.path.join(self.load_path, 'C2H6.yml')) self.assertIsInstance(arkane_spc, ArkaneSpecies) # checks make_object self.assertIsInstance(arkane_spc.molecular_weight, ScalarQuantity) self.assertIsInstance(arkane_spc.thermo, NASA) self.assertNotEqual(arkane_spc.author, '') self.assertEqual(arkane_spc.inchi, 'InChI=1S/C2H6/c1-2/h1-2H3') self.assertEqual(arkane_spc.inchi_key, 'OTMSDBZUPAUEDD-UHFFFAOYSA-N') self.assertEqual(arkane_spc.smiles, 'CC') self.assertTrue('8 H u0 p0 c0 {2,S}' in arkane_spc.adjacency_list) self.assertEqual(arkane_spc.label, 'C2H6') self.assertEqual(arkane_spc.frequency_scale_factor, 0.99) # checks float conversion self.assertFalse(arkane_spc.use_bond_corrections) self.assertAlmostEqual( arkane_spc.conformer.modes[2].frequencies.value_si[0], 818.91718, 4) # HarmonicOsc. self.assertIsInstance(arkane_spc.energy_transfer_model, SingleExponentialDown) self.assertFalse(arkane_spc.is_ts) self.assertTrue(arkane_spc.use_hindered_rotors) self.assertTrue('C 7.54e-14 1.193e-13 5.52e-14' in arkane_spc.xyz) self.assertIsInstance(arkane_spc.chemkin_thermo_string, str)
def test_create_and_load_yaml(self): """ Test properly loading the ArkaneSpecies object and respective sub-objects """ # Create YAML file by running Arkane job_list = self.arkane.load_input_file(self.dump_input_path) for job in job_list: job.execute(output_directory=self.dump_path) # Load in newly created YAML file arkane_spc_old = job_list[0].arkane_species arkane_spc = ArkaneSpecies.__new__(ArkaneSpecies) arkane_spc.load_yaml( path=os.path.join(self.dump_path, 'species', arkane_spc_old.label + '.yml')) self.assertIsInstance(arkane_spc, ArkaneSpecies) # checks make_object self.assertIsInstance(arkane_spc.molecular_weight, ScalarQuantity) self.assertIsInstance(arkane_spc.thermo, NASA) self.assertNotEqual(arkane_spc.author, '') self.assertEqual(arkane_spc.inchi, 'InChI=1S/C2H6/c1-2/h1-2H3') self.assertEqual(arkane_spc.inchi_key, 'OTMSDBZUPAUEDD-UHFFFAOYSA-N') self.assertEqual(arkane_spc.smiles, 'CC') self.assertTrue('8 H u0 p0 c0 {2,S}' in arkane_spc.adjacency_list) self.assertEqual(arkane_spc.label, 'C2H6') self.assertEqual(arkane_spc.frequency_scale_factor, 0.99 * 1.014) # checks float conversion self.assertFalse(arkane_spc.use_bond_corrections) self.assertAlmostEqual( arkane_spc.conformer.modes[2].frequencies.value_si[0], 830.38202, 4) # HarmonicOsc. self.assertIsInstance(arkane_spc.energy_transfer_model, SingleExponentialDown) self.assertFalse(arkane_spc.is_ts) self.assertEqual(arkane_spc.level_of_theory, 'cbs-qb3') self.assertIsInstance(arkane_spc.thermo_data, ThermoData) self.assertTrue(arkane_spc.use_hindered_rotors) self.assertIsInstance(arkane_spc.chemkin_thermo_string, str) expected_xyz = """8 C2H6 C 0.00075400 0.00119300 0.00055200 H 0.00074000 0.00117100 1.09413800 H 1.04376600 0.00117100 -0.32820200 H -0.44760300 0.94289500 -0.32825300 C -0.76014200 -1.20389600 -0.55748300 H -0.76012800 -1.20387400 -1.65106900 H -0.31178500 -2.14559800 -0.22867800 H -1.80315400 -1.20387400 -0.22872900""" self.assertEqual(arkane_spc.xyz, expected_xyz)
def test_create_and_load_yaml(self): """ Test properly loading the ArkaneSpecies object and respective sub-objects """ # Create YAML file by running Arkane jobList = self.arkane.loadInputFile(self.dump_input_path) for job in jobList: job.execute(output_directory=self.dump_path) # Load in newly created YAML file arkane_spc_old = jobList[0].arkane_species arkane_spc = ArkaneSpecies.__new__(ArkaneSpecies) arkane_spc.load_yaml( path=os.path.join(self.dump_path, 'species', arkane_spc_old.label + '.yml')) self.assertIsInstance(arkane_spc, ArkaneSpecies) # checks make_object self.assertIsInstance(arkane_spc.molecular_weight, ScalarQuantity) self.assertIsInstance(arkane_spc.thermo, NASA) self.assertNotEqual(arkane_spc.author, '') self.assertEqual(arkane_spc.inchi, 'InChI=1S/C2H6/c1-2/h1-2H3') self.assertEqual(arkane_spc.inchi_key, 'OTMSDBZUPAUEDD-UHFFFAOYSA-N') self.assertEqual(arkane_spc.smiles, 'CC') self.assertTrue('8 H u0 p0 c0 {2,S}' in arkane_spc.adjacency_list) self.assertEqual(arkane_spc.label, 'C2H6') self.assertEqual(arkane_spc.frequency_scale_factor, 0.99 * 1.014) # checks float conversion self.assertFalse(arkane_spc.use_bond_corrections) self.assertAlmostEqual( arkane_spc.conformer.modes[2].frequencies.value_si[0], 830.38202, 4) # HarmonicOsc. self.assertIsInstance(arkane_spc.energy_transfer_model, SingleExponentialDown) self.assertFalse(arkane_spc.is_ts) self.assertEqual(arkane_spc.level_of_theory, 'cbs-qb3') self.assertIsInstance(arkane_spc.thermo_data, ThermoData) self.assertTrue(arkane_spc.use_hindered_rotors) self.assertTrue('C 7.54e-14 1.193e-13 5.52e-14' in arkane_spc.xyz) self.assertIsInstance(arkane_spc.chemkin_thermo_string, str)