-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deterministic output #56
Comments
I can't reproduce that behavior. Which version of pydeps? Do you have a small testcase? |
I just ran this in for i in 1 2 3 4 5; do
pydeps pydeps --noshow --only pydeps -o pydeps.$i.svg
done Here are the resulting SVGs thumbnails: As you can see they all slightly differ from each other 🙂 I found some information in
If one of those |
Interesting, they're all exactly the same on Windows (and on WSL). I used this, which should be similar:
I'm afraid neither the neato nor the fdp layout engines are relevant since pydeps is using the
to
since I can't reproduce the problem I'll need someone else to test it (..and perhaps create a PR?) |
I tried this option but it didn't work. I also tried My graphviz version is |
Never noticed the output was not deterministic. Tried the onliner above on a small (3 files) project from $work, and while the layout was the same, in a couple the oval shapes were misplaced. Tried on Tornado, and the 5 images were different than each other. Tried the My env is Ubuntu LTS, Python Anaconda 3.7, dot - graphviz version 2.40.1 (20161225.0304). |
Hmm.. looks like this is a Python 3.x issue. I cannot reproduce with Py2.7 on any platform or graphviz configuration. Reproduced with Py3.6 + graphviz 2.40.1 on Ubuntu 18.04.4; and Py3.5 + graphviz 2.38.0 on Win10. |
Hmm.. the rule ordering in the dot file is also non-deterministic on Py3. We might get away with simply sorting the rules...? |
I'd be happy to try that out but I don't understand what you mean. By "rules" you mean the text input you feed to the dot command? |
…o deterministic graphs on Py3 (cf. issue #56). There is still an issue with random weight=5 being added on some runs.
@pawamoy I'm mostly just thinking out loudly - being able to reproduce the issue makes everything easier ;-) See the latest checkin (58bfcd7) for what I'm talking about. I'm pretty sure that if the dot source I generate is deterministic, then the resulting graphs will be as well. With the latest change we're almost there (some runs add a |
Nice! It's working well, I got the same result for over 100 runs! This is great, thanks 🙂 |
I've just release v1.9.1 which fixes this. Thanks for all the help. |
@thebjorn somehow I'm getting this issue. Nodes get random order, and some times the amount of nodes are different. I'm using pydeps v1.10.22, Python 3.10.6, Graphviz 2.43.0 and Ubuntu 20.04. |
Hi @greenled , I can't reproduce this with py3.10.2, pydeps 1.10.22 and graphviz 2.50.0 on windows 11, running pydeps on pydeps source. Do you have a testcase? |
The generated file changes each time I run pydeps again. Would it be possible to make the resulting SVG the same each time, as long as the source is the same as well?
The text was updated successfully, but these errors were encountered: