jamesscottbrown / pyyed

A simple Python library to export networks to yEd
BSD 3-Clause "New" or "Revised" License
82 stars 38 forks source link

node alredy exist #40

Open enzococca opened 3 years ago

enzococca commented 3 years ago

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")
bockor commented 3 years ago

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
....