You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As pointed out in the original issue, this may be expected (assuming graphviz doesn't allow empty nodes) but at the very least a more informative exception should be raised.
as gv.agnameof(nh) returns None when nh derives from an empty string. After verifying that graphviz indeed does not allow empty strings as nodes, this should be simple to fix by adding an extra condition or a try/except here.
The text was updated successfully, but these errors were encountered:
Is the PR number referenced in the comment correct? That’s a pr about sphinx.
I do see that agnameof Is defined twice in pygraphviz.i . Once just as calling the function and then a few lines later being defined directly using Python code. The comments suggest this is to handle anonymous edges. I’m not sure of the impact of that change. But it seems that it would be better to use different names for the two functions.
GraphViz itself allows empty strings as labels for nodes. At least the GraphViz playground works just fine with input of a dot file that uses “” as the node’s unique identifier.
This was originally reported to NetworkX in networkx/networkx#4834. [Edit: was pointing to #4855]
A minimal reproducing example:
As pointed out in the original issue, this may be expected (assuming graphviz doesn't allow empty nodes) but at the very least a more informative exception should be raised.
I think the problem resides around here:
pygraphviz/pygraphviz/agraph.py
Lines 1854 to 1855 in 8048d8c
as
gv.agnameof(nh)
returnsNone
whennh
derives from an empty string. After verifying that graphviz indeed does not allow empty strings as nodes, this should be simple to fix by adding an extra condition or a try/except here.The text was updated successfully, but these errors were encountered: