From 1bb5b0a4b7313fdfd08d6edfda6e50557b5357cf Mon Sep 17 00:00:00 2001 From: MarkGoldman Date: Wed, 20 Mar 2019 15:07:22 -0400 Subject: [PATCH] Test symmetry,optical isomers loaded --- arkane/gaussianTest.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arkane/gaussianTest.py b/arkane/gaussianTest.py index 20978c5386..96a870f46c 100644 --- a/arkane/gaussianTest.py +++ b/arkane/gaussianTest.py @@ -37,6 +37,7 @@ from external.wip import work_in_progress from arkane.gaussian import GaussianLog +from arkane.statmech import determine_qm_software ################################################################################ @@ -130,5 +131,32 @@ def testLoadEthyleneFromGaussianLog_G3(self): self.assertEqual(conformer.spinMultiplicity, 1) self.assertEqual(conformer.opticalIsomers, 1) + def testLoadSymmetryAndOptics(self): + """ + Uses a Gaussian03 log file for oxygen (O2) to test that its + molecular degrees of freedom can be properly read. + """ + + log = GaussianLog(os.path.join(os.path.dirname(__file__),'data','oxygen.log')) + optical, symmetry = log.get_optical_isomers_and_symmetry_number() + self.assertEqual(optical,1) + self.assertEqual(symmetry,2) + + conf = log.loadConformer()[0] + self.assertEqual(conf.opticalIsomers, 1) + found_rotor = False + for mode in conf.modes: + if isinstance(mode,LinearRotor): + self.assertEqual(mode.symmetry,2) + found_rotor = True + self.assertTrue(found_rotor) + + def testDetermineQMSoftware(self): + """ + Ensures that determine_qm_software returns a GaussianLog object + """ + log = determine_qm_software(os.path.join(os.path.dirname(__file__),'data','oxygen.log')) + self.assertIsInstance(log,GaussianLog) + if __name__ == '__main__': unittest.main( testRunner = unittest.TextTestRunner(verbosity=2) )