pyyed icon indicating copy to clipboard operation
pyyed copied to clipboard

node alredy exist

Open enzococca opened this issue 3 years ago • 1 comments

Hi, when try to run the code and appears this message, what means?

raise RuntimeWarning("Node %s already exists" % node_name)

this is my code:

    for s in self.periodi:
        
        s=yed.add_group(s[2])    
    
    for e in  self.sequence:
        s.add_node(e[0])  
        s.add_edge(e[0],e[1])
   
    
    for h in  self.negative:
        s.add_node(h[0])  
        s.add_edge(h[0],h[1])
    
    
    for j in  self.conteporene:
        s.add_node(j[0]) 
        s.add_edge(j[0],j[1],arrowfoot= "none")

enzococca avatar Feb 26 '21 15:02 enzococca

This error means that you try create a node with an existing node name. You could try:

for e in  self.sequence:
    try:
        s.add_node(e[0])
    except:
         pass
....

bockor avatar Apr 26 '21 11:04 bockor