From e77d985c5a583e3b5e62a85c18ae4c3b3208ed3a Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Thu, 4 Apr 2024 12:59:17 -0400 Subject: [PATCH] raise error when checking for same reactants if provided more than 3 reactants --- rmgpy/data/kinetics/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rmgpy/data/kinetics/common.py b/rmgpy/data/kinetics/common.py index 316152b9db..78b6712f29 100644 --- a/rmgpy/data/kinetics/common.py +++ b/rmgpy/data/kinetics/common.py @@ -263,6 +263,10 @@ def check_for_same_reactants(reactants): same_reactants = 2 elif reactants[1].is_isomorphic(reactants[2]): same_reactants = 2 + elif len(reactants) > 3: + raise ValueError('Cannot check for duplicate reactants if provided number of reactants is greater than 3. ' + 'Got: {} reactants'.format(len(reactants))) + return reactants, same_reactants def find_degenerate_reactions(rxn_list, same_reactants=None, template=None, kinetics_database=None,