File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ def cleanup_script_files():
284284nodes_dict = dict ()
285285node_id_to_label_map = dict () # Helper to get clean node labels from GraphML ID
286286
287- for node in nodes_text :
287+ for node in nodes_text :
288288 try :
289289 data = node .find ('data' , recursive = False )
290290 if data :
@@ -306,9 +306,15 @@ def cleanup_script_files():
306306
307307 nodes_dict [node ['id' ]] = node_label
308308 node_id_to_label_map [node ['id' ]] = node_label .split (':' )[0 ]
309- except (IndexError , AttributeError ):
310- logging .debug ('A node with no valid properties encountered and ignored' )
311-
309+ except (IndexError , AttributeError ):
310+ logging .debug ('A node with no valid properties encountered and ignored' )
311+
312+ label_values = list (nodes_dict .values ())
313+ duplicates = {label for label in label_values if label_values .count (label ) > 1 }
314+ if duplicates :
315+ logging .error (f"Duplicate node labels found: { sorted (duplicates )} " )
316+ quit ()
317+
312318for edge in edges_text :
313319 try :
314320 data = edge .find ('data' , recursive = False )
You can’t perform that action at this time.
0 commit comments