Skip to content
Snippets Groups Projects
Commit b7a42ca8 authored by George Marchment's avatar George Marchment
Browse files

Updated the difference in graphs print

parent 268ed73d
No related branches found
No related tags found
No related merge requests found
Pipeline #14652 failed with stage
in 2 minutes and 26 seconds
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment