Skip to content
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

Possible warning #109

Open
javier-romero opened this issue Dec 14, 2023 · 0 comments
Open

Possible warning #109

javier-romero opened this issue Dec 14, 2023 · 0 comments

Comments

@javier-romero
Copy link

I was using this viz.lp:

graph(T) :- time(T).
node((V,T),T) :- vertex(V), time(T).
edge((X,Y)) :- xedge(X,Y).

and got this error:

clingo robots.lp --outf=2 | clingraph --viz-encoding=test.lp  --out=animate --sort=asc-int  --engine=neato --dir='out' --type=digraph
Traceback (most recent call last):
  File "/home/davila/miniconda2/envs/clingraph/bin/clingraph", line 10, in <module>
    sys.exit(main())
  File "/home/davila/miniconda2/envs/clingraph/lib/python3.10/site-packages/clingraph/__init__.py", line 402, in main
    paths = save_gif(graphs,
  File "/home/davila/miniconda2/envs/clingraph/lib/python3.10/site-packages/clingraph/gif.py", line 60, in save_gif
    keys.sort(key = l_key, reverse = l_reverse)
ValueError: invalid literal for int() with base 10: 'default'

I was a bit lost with it, so I printed the keys variables and got:

['0', '1', '2', '3', 'default']

Only then I realized that I was somehow creating a new default graph, because the rule

edge((X,Y)) :- xedge(X,Y).

is adding the edges to that default graph.

I think it would be helpful to give some warning in this case, where the viz.lp defines some graphs, but (probably inadvertently) it also adds some edges or nodes to the default graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant