Skip to content

Commit 5c84603

Browse files
committed
Added Cl and Si to generatePairs() in reaction.py
1 parent 7758183 commit 5c84603

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

rmgpy/reaction.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,15 +916,19 @@ def generatePairs(self):
916916
productOxygens = [sum([1 for atom in product.molecule[0].atoms if atom.isOxygen()]) for product in products ]
917917
reactantNitrogens = [sum([1 for atom in reactant.molecule[0].atoms if atom.isNitrogen()]) for reactant in reactants]
918918
productNitrogens = [sum([1 for atom in product.molecule[0].atoms if atom.isNitrogen()]) for product in products ]
919+
reactantSilicons = [sum([1 for atom in reactant.molecule[0].atoms if atom.isSilicon()]) for reactant in reactants]
920+
productSilicons = [sum([1 for atom in product.molecule[0].atoms if atom.isSilicon()]) for product in products ]
919921
reactantSulfurs = [sum([1 for atom in reactant.molecule[0].atoms if atom.isSulfur()]) for reactant in reactants]
920922
productSulfurs = [sum([1 for atom in product.molecule[0].atoms if atom.isSulfur()]) for product in products ]
923+
reactantChlorines = [sum([1 for atom in reactant.molecule[0].atoms if atom.isChlorine()]) for reactant in reactants]
924+
productChlorines = [sum([1 for atom in product.molecule[0].atoms if atom.isChlorine()]) for product in products ]
921925

922926
# Sort the reactants and products by C/O/N/S numbers
923-
reactants = [(carbon, oxygen, nitrogen, sulfur, reactant) for carbon, oxygen, nitrogen, sulfur, reactant
924-
in zip(reactantCarbons,reactantOxygens,reactantNitrogens,reactantSulfurs,reactants)]
927+
reactants = [(carbon, oxygen, nitrogen, silicon, sulfur, chlorine, reactant) for carbon, oxygen, nitrogen, silicon, sulfur, chlorine, reactant
928+
in zip(reactantCarbons,reactantOxygens,reactantNitrogens,reactantSilicons,reactantSulfurs,reactantChlorines,reactants)]
925929
reactants.sort()
926-
products = [(carbon, oxygen, nitrogen, sulfur, product) for carbon, oxygen, nitrogen, sulfur, product
927-
in zip(productCarbons,productOxygens,productNitrogens,productSulfurs,products)]
930+
products = [(carbon, oxygen, nitrogen, silicon, sulfur, chlorine, reactant) for carbon, oxygen, nitrogen, silicon, sulfur, chlorine, reactant
931+
in zip(productCarbons,productOxygens,productNitrogens,productSilicons,productSulfurs,productChlorines,products)]
928932
products.sort()
929933

930934
while len(reactants) > 1 and len(products) > 1:

0 commit comments

Comments
 (0)