From 8487b3494f37b0d33925fb11642b32dc91e1b13f Mon Sep 17 00:00:00 2001 From: Mohammad Soleymannejad <20094187+muhammadsn@users.noreply.github.com> Date: Sun, 11 Dec 2022 02:28:21 +0330 Subject: [PATCH] Fixed RuntimeError (dictionary keys changed during iteration) --- combinationRules/zhangCombination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/combinationRules/zhangCombination.py b/combinationRules/zhangCombination.py index e57ad46..0e885cc 100644 --- a/combinationRules/zhangCombination.py +++ b/combinationRules/zhangCombination.py @@ -88,7 +88,7 @@ def multi_combination(evidence, all_data=None, weights=None): for evidence_key in evidence.keys(): all_data["last_evidence"] = {} # Reset all_data["evidence"][all_data["number_of_evidences"]] = deepcopy(evidence[evidence_key]) - for input_key in all_data["evidence"][all_data["number_of_evidences"]]: + for input_key in evidence[evidence_key]: # Convert any keys that aren't tuples to tuples if isinstance(input_key, tuple) is False: # Convert to a tuple