From 1118ddbf619b0dda35ac799cfecc30f591fcbb53 Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Mon, 30 Sep 2024 16:24:23 +0200
Subject: [PATCH] update

---
 src/outils_graph.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/outils_graph.py b/src/outils_graph.py
index 7248b4b..4e9b3ec 100644
--- a/src/outils_graph.py
+++ b/src/outils_graph.py
@@ -563,22 +563,16 @@ def relev_user_view_builder(dico, relevant_modules):
         U = set(U).union(M)
     #Step 2
     NRC = []
-    order = list(set(N) - set(R))
-    order.sort()
-    for n in order:
+    for n in set(N) - set(R):
         if(marked_statues[n] == 'unmarked'):
-            print(get_name_from_id(dico, n))
             def condition_line_13(NRC, n, dico, R, inputs, outputs):
+                def check_same_elements(list1, list2):
+                    return set(list1)==set(list2)
                 #Ms = generate_subsets(NRC)
                 for i in range(len(NRC)):
                     M = NRC[i]
-                    print("M", get_names_tab(dico, M), "-> rPredM", get_names_tab(dico, rPredM(M, dico, R, ["input"])))
-                    print('n', get_name_from_id(dico, n), '-> rPred', get_names_tab(dico, rPred(n, dico, R, ['input'])))
-                    print("M", get_names_tab(dico, M), "-> rSuccM", get_names_tab(dico, rSuccM(M, dico, R, ["output"])))
-                    print('n', get_name_from_id(dico, n), '-> rSucc', get_names_tab(dico, rSucc(n, dico, R, ['output'])))
-                    print()
-                    if(rPredM(M, dico, R, ["input"])==rPred(n, dico, R, ["input"]) and
-                       rSuccM(M, dico, R, ['output'])==rSucc(n , dico, R, ['output'])):
+                    if(check_same_elements(rPredM(M, dico, R, ["input"]), rPred(n, dico, R, ["input"])) and
+                       check_same_elements(rSuccM(M, dico, R, ['output']), rSucc(n , dico, R, ['output']))):
                         return True, i
                 return False, -1
             
@@ -587,7 +581,6 @@ def relev_user_view_builder(dico, relevant_modules):
             check, index = condition_line_13(NRC, n, dico, R, ["input"], ['output'])
             if(check):
                 NRC[index].append(n)
-                print("here")
             else:
                 M = [n]
                 NRC.append(M)
-- 
GitLab