Skip to content

Commit

Permalink
added exception families
Browse files Browse the repository at this point in the history
  • Loading branch information
donerancl committed Nov 22, 2024
1 parent 8c69b97 commit b1115f9
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
specified reactants and products within this family.
Degenerate reactions are returned as separate reactions.
"""

check_spin = True
rxn_list = []

# Wrap each reactant in a list if not already done (this is done to
Expand Down Expand Up @@ -1892,7 +1892,9 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
pass
else:
if product_structures is not None:
rxn = self._create_reaction(reactant_structures, product_structures, forward)
if self.label in allowed_spin_violation_families:
check_spin = False
rxn = self._create_reaction(reactant_structures, product_structures, forward, check_spin = check_spin)
if rxn:
rxn_list.append(rxn)
# Bimolecular reactants: A + B --> products
Expand Down Expand Up @@ -1935,7 +1937,9 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
pass
else:
if product_structures is not None:
rxn = self._create_reaction(reactant_structures, product_structures, forward)
if self.label in allowed_spin_violation_families:
check_spin = False
rxn = self._create_reaction(reactant_structures, product_structures, forward, check_spin = check_spin)
if rxn:
rxn_list.append(rxn)

Expand All @@ -1959,8 +1963,9 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
pass
else:
if product_structures is not None:
rxn = self._create_reaction(reactant_structures, product_structures,
forward)
if self.label in allowed_spin_violation_families:
check_spin = False
rxn = self._create_reaction(reactant_structures, product_structures, forward, check_spin = check_spin)
if rxn:
rxn_list.append(rxn)

Expand Down Expand Up @@ -2013,7 +2018,9 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
pass
else:
if product_structures is not None:
rxn = self._create_reaction(reactant_structures, product_structures, forward)
if self.label in allowed_spin_violation_families:
check_spin = False
rxn = self._create_reaction(reactant_structures, product_structures, forward, check_spin = check_spin)
if rxn:
rxn_list.append(rxn)
else:
Expand Down Expand Up @@ -2078,7 +2085,9 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson
pass
else:
if product_structures is not None:
rxn = self._create_reaction(reactant_structures, product_structures, forward)
if self.label in allowed_spin_violation_families:
check_spin = False
rxn = self._create_reaction(reactant_structures, product_structures, forward, check_spin = check_spin)
if rxn:
rxn_list.append(rxn)

Expand Down Expand Up @@ -4524,3 +4533,5 @@ def average_kinetics(kinetics_list):
Ea=(Ea * 0.001, "kJ/mol"),
)
return averaged_kinetics

allowed_spin_violation_families =['1,2-Birad_to_alkene','1,4_Cyclic_birad_scission','1,4_Linear_birad_scission']

0 comments on commit b1115f9

Please sign in to comment.