Comments (6)
It will parse it ( in the latest tests it already does )
PS: The code is shaping up. It's taking forever to release the updated pydot
because I embarked on rewriting pydot
's core aiming at increasing performance and supporting some advanced constructs/expressions that weren't supported before. And that took a bit of thinking plus extensive regression tests. It will eventually see the light of day.
Original comment by [email protected]
on 21 Jan 2008 at 1:59
from pydot.
Sorry it's my mistake, it parses comma not in same way as graphviz. But seems
that specification doesn't allow comma here. So following works:
a -> {b c}
a -> {b; c}
Sorry for the noise.
Original comment by [email protected]
on 22 Jan 2008 at 6:48
from pydot.
Well, I'm here again :)
There are problems with parsing other way around:
{b; c} -> a
Error is:
TypeError: unsupported operand type(s) for +: 'Subgraph' and 'str'
BTW, I've not found any unittests here. Is this something you do in private
repository? I'd like to help with tests and maybe some code (although I'm not
familiar with pyparsing yet).
Original comment by [email protected]
on 28 Jan 2008 at 7:39
from pydot.
Same with:
a -> b -> {c; d}
Original comment by [email protected]
on 28 Jan 2008 at 7:50
from pydot.
All of those cases should be fixed in the ucoming 1.0.2. I've given the parsing code a good update.
Regarding the unittests, I've put some together for this latest version. I don't think I'll include them in the main release (loads of .dot
files) but let me know if you want them.
Original comment by [email protected]
on 14 Feb 2008 at 10:06
- Changed state: fixed
from pydot.
Of all the examples given in this thread, the only one I am still seeing a problem with is this one:
digraph G{
a -> b -> {c; d}
}
Expected result, as when loaded directly by Graphviz:
Actual result when first parsed by pydot, then sent to Graphviz:
The pydot parser only returns a -> b
:
> dot_parser.py(548)parse_dot_data()
-> tokens = graphparser.parseString(s)
(Pdb) n
> dot_parser.py(549)parse_dot_data()
-> return list(tokens)
(Pdb) pp tokens
([<pydot.Dot object at 0x7f5b49cfaf98>], {})
(Pdb) pp tokens[0].obj_dict
{'attributes': {},
'current_child_sequence': 2,
'edges': {('a', 'b'): [{'attributes': {},
'parent_edge_list': None,
'parent_graph': <pydot.Dot object at 0x7f5b49cfaf98>,
'points': ('a', 'b'),
'sequence': 1,
'type': 'edge'}]},
'name': 'G',
'nodes': {},
'parent_graph': <pydot.Dot object at 0x7f5b49cfaf98>,
'simplify': False,
'strict': False,
'subgraphs': {},
'suppress_disconnected': False,
'type': 'digraph'}
However, a graph with a -> b -> c
gets correctly parsed as a -> b; b -> c;
. And a graph with a -> {b; c}
also gets correctly parsed as a -> subgraph { b; c; }
as well. It is just the mix of these two that does not work.
It is not easy to debug the parsing by stepping through the code. Instead, PyParsing has some special debugging functions. I do not know when I will get around to that, so anyone else feel free to pick this up.
Versions: pydot 1.4.1, pyparsing 2.4.7, python 3.7.3.
from pydot.
Related Issues (20)
- Parser error for final ';' HOT 4
- Graph object cannot have name "graph" as it breaks GraphViz HOT 3
- what is difference for networkx between pydot and PyGraphviz HOT 1
- File "/usr/local/lib/python3.7/site-packages/pydot.py", line 1933, in create raise OSError(*args) FileNotFoundError: [Errno 2] "dot" not found in path. HOT 3
- May the .dot file is too large?? HOT 1
- Document SVG Rendering for Jupyter Notebook
- Add labels to edges
- error when writing to file
- Pydot does not work with pyparser >= 3
- Writing a png a long time but still no output
- Linebreaks in the .dot file are recognized as a separate node HOT 2
- Can pydot parse the dot file generated by joern HOT 2
- graphviz 7.0.x asserts on penwidth=nan HOT 5
- Images rendered have incorrect/corrupted labels HOT 1
- Parameter not used anywhere in code... HOT 3
- Style is wrongly represented in the dot file for style="rounded,filled" elements HOT 1
- Rare inconsistencies between Graphviz and Pydot HOT 1
- A Request For a New Release on PyPI HOT 2
- Android: not built with triangulation library HOT 5
- pyclean: py3clean dependency on debpython HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydot.