diff --git a/src/outils_graph.py b/src/outils_graph.py index e5e08c2869a72e7e67306e35f82d82e54a48f135..888512d3dba410fb49a8aaeccc403245bdd33f6e 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