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
{{ message }}
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
This library is API compatible with original pydot so you can use it like this: import pydot_ng as pydot
Of course, this hasn't been true for over three years; pydot-ng only adheres to the oldpydot API. The newpydot API is considerably different. Downstream consumers that actually try to import pydot_ng as pydot are gonna have a Bad Time™.
Just Shoot Me Now
Notably, most top-level pydot functions and methods (e.g., pydot.graph_from_dot_data()) now unconditionally return a list of one or more Graph objects rather than conditionally returning either a single Graph object or a list of two or more Graph objects. To quote @johnyf in an ancient pydot issue:
An earlier version of the API used to return a graph object when the dot file defined one graph, and a list of graphs otherwise (in the case of more graphs). However, I found that the inhomogeneous behavior is more complex (simple is better than complex, PEP 20), so I changed it to return a list in all cases (e.g., a list containing one graph). This simplifies also user code, because there no case distinction needs to be made.
These are useful changes – but they do break backward compatibility. For conformance with the modern pydot API, it's critical that the pydot-ng API be refactored to behave similarly.
But... Can It Be Done?
It can! With perseverance and hideous suffering, anything is possible.
Since these API changes are largely undocumented, the simplest solution might be to:
Best of luck, @prmtl. I'd submit a pull request resolving this, but we have our hands full just trying to survive the oncoming Canadian winter. Because in Canada, winter is always coming.
Perpetual snow and unyielding darkness. It isn't easy, folks. ❄️ ☃️ 🏔️
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
README.rst
boldly claims that:Of course, this hasn't been true for over three years;
pydot-ng
only adheres to the oldpydot
API. The newpydot
API is considerably different. Downstream consumers that actually try toimport pydot_ng as pydot
are gonna have a Bad Time™.Just Shoot Me Now
Notably, most top-level
pydot
functions and methods (e.g.,pydot.graph_from_dot_data()
) now unconditionally return alist
of one or moreGraph
objects rather than conditionally returning either a singleGraph
object or alist
of two or moreGraph
objects. To quote @johnyf in an ancientpydot
issue:These are useful changes – but they do break backward compatibility. For conformance with the modern
pydot
API, it's critical that thepydot-ng
API be refactored to behave similarly.But... Can It Be Done?
It can! With perseverance and hideous suffering, anything is possible.
Since these API changes are largely undocumented, the simplest solution might be to:
pydot
test suite into the existingpydot-ng
test suite.For these purposes,
test/pydot_unittest.py
is the only useful file. Relevant unit tests include:test_attribute_with_implicit_value
.test_unicode_ids
.test_graph_with_shapefiles
.test_multiple_graphs
.Godspeed You Intrepid Coder!
Best of luck, @prmtl. I'd submit a pull request resolving this, but we have our hands full just trying to survive the oncoming Canadian winter. Because in Canada, winter is always coming.
Perpetual snow and unyielding darkness. It isn't easy, folks. ❄️ ☃️ 🏔️
The text was updated successfully, but these errors were encountered: