-
Notifications
You must be signed in to change notification settings - Fork 205
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
ValueError: agread: bad input data, first read normal. second error, retry second normal #489
Comments
What is the code you are using and with what inputs. I don’t understand the output. It says at the top there is a syntax error at a line you don’t show here. Then it says there is a ValueError. But what was the value provided to the function. Ideally we would have a short bit of code that reproduces the error along with system and library version so we can reproduce it locally. |
you can reproduce it with this code |
Thanks, that helps. I created a dot file with a single edge and two nodes with the name from the example. I was able to run the example code without error. And I separately loaded the file 3 times to different variables and could check that they have the same nodes and edges. my installed pygraphviz is v1.10. And the Python version I used is 3.10. ——— |
pygrphviz-1.11
python-3.10
dot_file
test_code (add print(e))
run_ret
OS:
graphviz version:
|
I can't reproduce this with pygraphviz 1.10 or 1.11 on either Python 3.10 or 3.11. If I copy the contents >>> import pygraphviz as pgv
>>> pgv.__version__ # for example
'1.11'
>>> for _ in range(10): # read from file 10 times
... A = pgv.AGraph("cinn_subgraph.dot") I don't get any exceptions, and the results are the same every time: >>> expected = pgv.AGraph("cinn_subgraph.dot")
>>> for _ in range(100):
... A = pgv.AGraph("cinn_subgraph.dot")
... assert A.nodes() == expected.nodes()
... assert A.edges() == expected.edges() In the OP you mention a batch process - are you reading and writing to files in these batch processes? Bear in mind that graphviz can modify the underlying dotfiles when modifying the AGraph for some operations, e.g. during layout (depending on how things are called). So if you have a script that is e.g. reading and laying out graphs (esp. if it's multithreaded) then that'd be my prime suspect for the source of the issue you're experiencing. |
I have a batch processing task that will read batch dot files. Reading the first dot file is normal. When reading the second file, an error will be reported. However, if the second file is read again, it will be normal.
The text was updated successfully, but these errors were encountered: