From b7a42ca8be760ae0bd815a6281f25c1f4cdc7f25 Mon Sep 17 00:00:00 2001 From: George Marchment <georgemarchment@yahoo.fr> Date: Tue, 22 Apr 2025 12:47:39 +0200 Subject: [PATCH] Updated the difference in graphs print --- src/outils_graph.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/outils_graph.py b/src/outils_graph.py index e5e08c2..888512d 100644 --- a/src/outils_graph.py +++ b/src/outils_graph.py @@ -1175,13 +1175,15 @@ def check_if_equal(dicoA, dicoB): translated_new, translated_original = translate_dico(dicoA), translate_dico(dicoB) #TO do that we rewrite the structure using a commun language (without using the ids) -> then just check if the translated structures are the same equal = translated_new == translated_original + from collections import Counter + if(not equal): #TODO -> make a better affichage des differences if(translated_new['nodes']!=translated_original["nodes"]): - diff = list(set(translated_original['nodes']) - set(translated_new['nodes'])) + diff = list(Counter(translated_original['nodes']) - Counter(translated_new['nodes'])) if(diff!=[]): print(f"The processes {diff} are missing from the new workflow") - diff = list(set(translated_new['nodes']) - set(translated_original['nodes'])) + diff = list(Counter(translated_new['nodes']) - Counter(translated_original['nodes'])) if(diff!=[]): print(f"The processes {diff} have been added to the new workflow") @@ -1191,10 +1193,10 @@ def check_if_equal(dicoA, dicoB): edges_original.append(str(e)) for e in translated_new['edges']: edges_new.append(str(e)) - diff = list(set(edges_original) - set(edges_new)) + diff = list(Counter(edges_original) - Counter(edges_new)) if(diff!=[]): print(f"The edges {diff} are missing from the new workflow") - diff = list(set(edges_new) - set(edges_original)) + diff = list(Counter(edges_new) - Counter(edges_original)) if(diff!=[]): print(f"The edges {diff} have been added to the new workflow") return equal -- GitLab