Closed galenseilis closed 1 year ago
Would you mind posting the versions of pygraphviz
and networkx
that are installed here? My first guess is that something changed in a version pygraphviz
, but it's hard to say without knowing more.
Would you mind posting the versions of
pygraphviz
andnetworkx
that are installed here? My first guess is that something changed in a versionpygraphviz
, but it's hard to say without knowing more.
pygraphviz: 1.10 networkx: 2.8.8
I haven't forgotten about this, I've just been a little busy lately. I will look into it further soon(ish).
Okay, finally got around to this and I was able to reproduce your warnings. I did the following
poetry new qt-pygraphvis-warnings
cd qt-pygraphvis-warnings
poetry add 'queueing-tool[plotting]'
poetry add pygraphviz
poetry add --groups dev ipython
source $(poetry env info --path)/bin/activate
ipython
And then ran exactly what you posted above. My pyproject.toml
looks like this:
[tool.poetry]
name = "qt-pygraphvis-warnings"
version = "0.1.0"
description = ""
authors = ["djordon <dan.jordon@gmail.com>"]
readme = "README.md"
packages = [{include = "qt_pygraphvis_warnings"}]
[tool.poetry.dependencies]
python = "^3.9"
queueing-tool = {extras = ["plotting"], version = "^1.2.5"}
pygraphviz = "^1.11"
[tool.poetry.group.dev.dependencies]
ipython = "^8.14.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
I think this is more of a pygraphviz
or networkx
issue, since queueing-tool
uses them under the hood. I was able to silence those warning by switching to a different graph layout program. Instead of using fdp
I used dot
and things worked as expected (as in no warnings). The only wrinkle is that the graph now looks a little different. Here is the code
import queueing_tool as qt
import networkx as nx
g = qt.generate_random_graph(200, seed=3)
q = qt.QueueNetwork(g, seed=3)
q.max_agents = 20000
q.initialize(100)
q.simulate(10000)
pos = nx.nx_agraph.graphviz_layout(g.to_undirected(), prog='dot')
scatter_kwargs = {'s': 30}
q.draw(pos=pos, scatter_kwargs=scatter_kwargs, bgcolor=[0,0,0,0],
figsize=(10, 16), fname='fig-dot.png',
bbox_inches='tight')
And here is the new graph:
Here is the graph with fdp
layout program:
So, I don't think this is a queueing-tool
issue. I'm glad you opened it since I didn't know that this happens, but there is not much I can do here to "fix it" besides up date the docs to use the different pygraphviz program layout (which is what I'll do).
@djordon I appreciate you looking into this issue at depth.
I ran this example:
And I am getting these warnings:
What do these warnings mean?