def loadReaction(label, reactants, products, transitionState, degeneracy=1): global speciesDict, transitionStateDict, reactionDict logging.info('Loading reaction %s...' % label) rxn = Reaction( reactants=[speciesDict[s] for s in reactants], products=[speciesDict[s] for s in products], transitionState=transitionStateDict[transitionState], ) rxn.degeneracy = degeneracy reactionDict[label] = rxn
def get_reaction_for_entry(entry, database): """ Return a Reaction object for a given entry that uses Species instead of Molecules (so that we can compute the reaction thermo). """ reaction = Reaction(reactants=[], products=[]) for reactant in entry.item.reactants: reactant.generate_resonance_structures() reactant.thermo = generate_thermo_data(reactant, database) reaction.reactants.append(reactant) for product in entry.item.products: product.generate_resonance_structures() product.thermo = generate_thermo_data(product, database) reaction.products.append(product) reaction.kinetics = entry.data reaction.degeneracy = entry.item.degeneracy return reaction
def getReactionForEntry(entry, database): """ Return a Reaction object for a given entry that uses Species instead of Molecules (so that we can compute the reaction thermo). """ reaction = Reaction(reactants=[], products=[]) for molecule in entry.item.reactants: molecule.makeHydrogensExplicit() reactant = Species(molecule=[molecule], label=molecule.toSMILES()) reactant.generate_resonance_structures() reactant.thermo = generateThermoData(reactant, database) reaction.reactants.append(reactant) for molecule in entry.item.products: molecule.makeHydrogensExplicit() product = Species(molecule=[molecule], label=molecule.toSMILES()) product.generate_resonance_structures() product.thermo = generateThermoData(product, database) reaction.products.append(product) reaction.kinetics = entry.data reaction.degeneracy = entry.item.degeneracy return reaction
def getReactionForEntry(entry, database): """ Return a Reaction object for a given entry that uses Species instead of Molecules (so that we can compute the reaction thermo). """ reaction = Reaction(reactants=[], products=[]) for molecule in entry.item.reactants: molecule.makeHydrogensExplicit() reactant = Species(molecule=[molecule], label=molecule.toSMILES()) reactant.generateResonanceIsomers() reactant.thermo = generateThermoData(reactant, database) reaction.reactants.append(reactant) for molecule in entry.item.products: molecule.makeHydrogensExplicit() product = Species(molecule=[molecule], label=molecule.toSMILES()) product.generateResonanceIsomers() product.thermo = generateThermoData(product, database) reaction.products.append(product) reaction.kinetics = entry.data reaction.degeneracy = entry.item.degeneracy return reaction