question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colon in Node names and edges

See original GitHub issue

Hello,

There are a few other open tickets from a bit ago about this. Anyway, I was stumbled over it for a bit as I have nodes which are essentially objects which translate with a colon in it. However, this was difficult to debug as the output was still valid as the Node names stripped everything after the colon although the same does not happen for the edges, ie:

# In:
G.add_edge("(thing :test)", "(thing)", label="A Link")
import sys
from networkx.drawing.nx_pydot import write_dot
write_dot(G, sys.stdout)

# Out:
strict graph  {
    "(thing ";
    "(thing)";
    "(thing :test" -- "(thing)"  [label="A Link"];
}

So I’m using networkx but I know it calls into pydot.to_pydot(…) The problem is that the edge is different to the node meaning you end up with weird duplicates/nodes that are not attached to anything.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
jameshfishercommented, Mar 7, 2021

I’m guessing this is the same issue:

>>> import pydot
>>> dot = pydot.Dot()
>>> dot.add_node(pydot.Node("x:0"))
>>> dot.get_node("x:0")
[]

Pydot’s job is to hide the dot syntax behind a Python API. As : is part of the dot syntax, if a colon is part of a name, pydot should either escape it, or raise an error. Pydot should provide some pure Python way to specify these “ports” and “compass points”, e.g. pydot.Node(("id", "port", "compass_point")).

1reaction
peternoweecommented, Mar 7, 2021

Agreed. pydot/pydot#118 is probably a duplicate of this issue, where the conclusion was the same. I am currently busy looking for work, but hope to pick up pydot work in the evenings once everything stabilizes again. Feel free to open a PR in the mean time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XPath query for XML node with colon in node name
That "node with a colon" is a node using an XML namespace (defined in the <rss version="2.0" xmlns:media="search.yahoo.com/mrss"> node) - you need to...
Read more >
8. Node and Edge Column Data - Cytoscape manual
Cytoscape allows the user to add arbitrary node, edge and network information to ... Namespace and column name are separated by a double...
Read more >
Nodes and Edges - PGF/TikZ Manual
Your node name should not contain any punctuation like a dot, a comma, or a colon since these are used to detect what...
Read more >
Graph Language Tutorial (Msc-generator 6.3.0)
After this, you can list nodes and edges enclosed between curly braces. ... Node names are underlined the first time they are used...
Read more >
11 Nodes
Thus, you can name a node just 1 or perhaps start of chart or even y_1. Your node name should not contain any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found