def testGetRingGroupsFromComments(self): """ Test that getRingGroupsFromComments method works for fused polycyclics. """ # set-up RMG object rmg = RMG() # load kinetic database and forbidden structures rmg.database = RMGDatabase() path = os.path.join(settings['database.directory']) # forbidden structure loading rmg.database.loadThermo(os.path.join(path, 'thermo')) smi = 'C12C(C3CCC2C3)C4CCC1C4'#two norbornane rings fused together spc = Species().fromSMILES(smi) spc.generateThermoData(rmg.database) thermodb = rmg.database.thermo thermodb.getRingGroupsFromComments(spc.thermo) import rmgpy.data.rmg rmgpy.data.rmg.database = None
def testGetRingGroupsFromComments(self): """ Test that getRingGroupsFromComments method works for fused polycyclics. """ # set-up RMG object rmg = RMG() # load kinetic database and forbidden structures rmg.database = RMGDatabase() path = os.path.join(settings['database.directory']) # forbidden structure loading rmg.database.loadThermo(os.path.join(path, 'thermo')) smi = 'C12C(C3CCC2C3)C4CCC1C4' #two norbornane rings fused together spc = Species().fromSMILES(smi) spc.generateThermoData(rmg.database) thermodb = rmg.database.thermo thermodb.getRingGroupsFromComments(spc.thermo) import rmgpy.data.rmg rmgpy.data.rmg.database = None
print 'Loading {0} library'.format(libraryName) kineticLibrary = database.kinetics.libraries[libraryName] reactionList = [] for index, entry in kineticLibrary.entries.iteritems(): reaction = entry.item reaction.kinetics = entry.data reactionList.append(reaction) speciesList = [] index = 0 for spec in kineticLibrary.getSpecies().values(): index = index + 1 species = Species(molecule = spec.molecule) species.generateThermoData(database) species.index = index speciesList.append(species) for reaction in reactionList: for reactant in reaction.reactants: for spec in speciesList: if reactant.isIsomorphic(spec): reactant.index = spec.index spec.label = reactant.label for product in reaction.products: for spec in speciesList: if product.isIsomorphic(spec): product.index = spec.index spec.label = product.label
reactionList = [] for index, entry in kineticLibrary.entries.iteritems(): reaction = entry.item reaction.kinetics = entry.data reactionList.append(reaction) speciesList = [] index = 0 speciesDict = kineticLibrary.getSpecies( os.path.join(settings['database.directory'], 'kinetics', 'libraries', libraryName, 'dictionary.txt')) for spec in speciesDict.values(): index = index + 1 species = Species(molecule=spec.molecule) species.generateThermoData(database) species.index = index speciesList.append(species) for reaction in reactionList: for reactant in reaction.reactants: for spec in speciesList: if reactant.isIsomorphic(spec): reactant.index = spec.index spec.label = reactant.label for product in reaction.products: for spec in speciesList: if product.isIsomorphic(spec): product.index = spec.index spec.label = product.label