def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.reaction2 = Reaction(rmg_reaction=RMGReaction( reactants=[RMGMolecule(smiles="CC"), RMGMolecule(smiles="[O]O")], products=[RMGMolecule(smiles="[CH2]C"), RMGMolecule(smiles="OO")]))
def test_reaction_families(self): # R_Addition_MultipleBond reaction = Reaction("C#C+[OH]_[CH]=CO") _, family = reaction.get_labeled_reaction() self.assertEqual(family.lower(), "R_Addition_MultipleBond".lower()) # intra_H_migration reaction = Reaction("C[CH]O_CC[O]") _, family = reaction.get_labeled_reaction() self.assertEqual(family.lower(), "intra_H_migration".lower())
def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.reaction2 = Reaction(rmg_reaction=RMGReaction( reactants=[RMGMolecule(smiles="CC"), RMGMolecule(smiles="[O]O")], products=[RMGMolecule(smiles="[CH2]C"), RMGMolecule(smiles="OO")])) self.ts = self.reaction.ts["forward"][0] self.ts2 = self.reaction.ts["forward"][0] self.ts.get_molecules() self.ts2.get_molecules()
def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.io = InputOutput( reaction=self.reaction, directory=os.path.expandvars("$AUTOTST/test/") ) try: os.makedirs(os.path.join( os.path.expandvars("$AUTOTST/test/"), "ts", self.reaction.label )) except OSError: try: shutil.copy( os.path.join( os.path.expandvars("$AUTOTST/test/bin/log-files"), self.reaction.label + "_forward_0.log" ), os.path.join( os.path.expandvars("$AUTOTST/test/"), "ts", self.reaction.label, self.reaction.label + ".log" ) ) except: pass
def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.reaction.get_labeled_reaction() self.reaction.generate_reactants_and_products() directory = os.path.expandvars("$AUTOTST/test") if not os.path.exists( os.path.join(directory, "ts", self.reaction.label)): os.makedirs(os.path.join(directory, "ts", self.reaction.label)) if not os.path.exists( os.path.join(directory, "ts", self.reaction.label, self.reaction.label + ".log")): shutil.copy( os.path.join(directory, "bin", "log-files", self.reaction.label + "_forward_0.log"), os.path.join(directory, "ts", self.reaction.label, self.reaction.label + ".log")) for sp in self.reaction.reactants + self.reaction.products: for smiles in sp.conformers.keys(): if not os.path.exists( os.path.join(directory, "species", smiles)): os.makedirs(os.path.join(directory, "species", smiles)) if not os.path.exists( os.path.join(directory, "species", smiles, smiles + ".log")): shutil.copy( os.path.join(directory, "bin", "log-files", smiles + "_0.log"), os.path.join(directory, "species", smiles, smiles + ".log")) self.statmech = StatMech(reaction=self.reaction, directory=directory)
def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.reaction.get_labeled_reaction() self.ts = self.reaction.ts["forward"][0] self.ts.get_molecules() directory = os.path.expandvars("$AUTOTST/test") if not os.path.exists( os.path.join(directory, "ts", self.reaction.label, "conformers")): os.makedirs( os.path.join(directory, "ts", self.reaction.label, "conformers")) if not os.path.exists( os.path.join(directory, "ts", self.reaction.label, self.reaction.label + ".log")): shutil.copy( os.path.join(directory, "bin", "log-files", self.reaction.label + "_forward_0.log"), os.path.join(directory, "ts", self.reaction.label, "conformers", self.reaction.label + "_forward_0.log")) self.directory = directory self.vibrational_analysis = VibrationalAnalysis( transitionstate=self.ts, directory=self.directory)
def setUp(self): os.environ["PATH"] = os.path.expandvars( "$AUTOTST/test/bin:") + os.environ["PATH"] rxn = Reaction(label='C+[O]O_[CH3]+OO') ts = rxn.ts["forward"][0] ts.get_molecules() self.gaussian = Gaussian(conformer=ts)
def setUp(self): os.environ["PATH"] = os.path.expandvars( "$AUTOTST/test/bin:") + os.environ["PATH"] self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.calculator = Gaussian( directory=os.path.expandvars("$AUTOTST/test")) self.job = Job(reaction=self.reaction, calculator=self.calculator, partition="test")
def test_symmetry_number(self): self.assertEquals(self.ts.symmetry_number, 1) self.assertEquals(self.ts2.symmetry_number, 1) reactions_to_test = { "[CH3]+[OH]_C+[O]": 3, # TODO add other reactions here } for reaction_string, expected_symmetry in reactions_to_test.items(): rxn = Reaction(reaction_string) rxn.get_labeled_reaction() ts = rxn.ts["forward"][0] self.assertEquals(ts.symmetry_number, expected_symmetry)
def test_estimate_distances(self): reaction = Reaction("CC+[O]O_[CH2]C+OO") labeled_reaction, _ = reaction.get_labeled_reaction() distance_data = self.ts_database.estimate_distances(labeled_reaction) d12 = 1.38 d13 = 2.53 # d13 in reactionTest is smaller than the distance in baseTest.py because # d13 is edited to be smaller in reaction.py. The value returned from the database # is ~2.53 but is reduced to ~2.43 when called from the reaction object itself d23 = 1.16 self.assertAlmostEquals(d12, distance_data.distances["d12"], places=1) self.assertAlmostEquals(d13, distance_data.distances["d13"], places=1) self.assertAlmostEquals(d23, distance_data.distances["d23"], places=1)
def setUp(self): os.environ["PATH"] = os.path.expandvars( "$AUTOTST/test/bin:") + os.environ["PATH"] os.environ["TEST_STATUS"] = "None" self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.calculator = Gaussian( directory=os.path.expandvars("$AUTOTST/test")) self.job = Job(reaction=self.reaction, calculator=self.calculator, partition="test", username="******", exclude="test", account="test") self.job2 = Job(reaction=self.reaction, calculator=self.calculator, partition="test", username="******", exclude="test", account=["test"])
def setUp(self): rxn = Reaction(label='C+[O]O_[CH3]+OO') ts = rxn.ts["forward"][0] ts.get_molecules() self.gaussian = Gaussian(conformer=ts)
def setUp(self): self.reaction = Reaction("CC+[O]O_[CH2]C+OO") self.family = "H_Abstraction" self.method = "m062x/cc-pVTZ" self.short_description = "test case"