From 96b2e7b0082a27e8e8e70008cd807703b445cc8c Mon Sep 17 00:00:00 2001 From: Aldrich Fan Date: Wed, 21 Feb 2024 22:06:02 -0800 Subject: [PATCH] fix bug in non constant params --- ratesb_python/common/analyzer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ratesb_python/common/analyzer.py b/ratesb_python/common/analyzer.py index db89c03..f77418f 100644 --- a/ratesb_python/common/analyzer.py +++ b/ratesb_python/common/analyzer.py @@ -594,10 +594,14 @@ def _check_constant_parameters(self, **kwargs): reaction_id = kwargs["reaction_id"] parameters_in_kinetic_law_only = kwargs["parameters_in_kinetic_law_only"] non_constant_params = kwargs["non_constant_params"] - if len(non_constant_params) > 0: - non_constant_params = ",".join(non_constant_params) + non_constant_params_in_kinetic_law = [] + for param in parameters_in_kinetic_law_only: + if param in non_constant_params: + non_constant_params_in_kinetic_law.append(param) + if len(non_constant_params_in_kinetic_law) > 0: + non_constant_params_in_kinetic_law = ",".join(non_constant_params_in_kinetic_law) self.results.add_message( - reaction_id, 1006, f"Expecting these parameters to be constants: {non_constant_params}") + reaction_id, 1006, f"Expecting these parameters to be constants: {non_constant_params_in_kinetic_law}") def _check_irreversibility(self, **kwargs): """