#13624: KeyError raised by GraphLatex.dot2tex_picture when edge_labels=True
-------------------------------------+--------------------------------------
       Reporter:  slabbe             |         Owner:  tbd     
           Type:  defect             |        Status:  new     
       Priority:  major              |     Milestone:  sage-5.5
      Component:  optional packages  |    Resolution:          
       Keywords:  dot2tex            |   Work issues:          
Report Upstream:  N/A                |     Reviewers:          
        Authors:                     |     Merged in:          
   Dependencies:                     |      Stopgaps:          
-------------------------------------+--------------------------------------
Description changed by slabbe:

Old description:

> The following is ok :
>
> {{{
> sage: G = DiGraph()
> sage: G.add_edge(3333, 88, 'my_label')
> sage: opts = G.latex_options()
> sage: opts.set_options(format='dot2tex')
> sage: view(G)
> }}}
>
> but with `edges_labels=True` a !KeyError is raised :
>
> {{{
> sage: opts.set_options(edge_labels=True)
> sage: view(G)
> ERROR    Failed to process input
> Traceback (most recent call last):
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 2939, in main
>     s =  conv.convert(dotdata)
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 794, in convert
>     return self.do_preview_preproc()
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 1167, in do_preview_preproc
>     hp,dp,wt = pp.texdims[name]
> KeyError: '3333880'
> }}}
>
> The error is also raised by `dot2tex_picture` method:
>
> {{{
> sage: G = DiGraph()
> sage: G.add_edge(0, 1, 'p0')
> sage: opts = G.latex_options()
> sage: opts.dot2tex_picture()
> '\n\\begin{tikzpicture}[>=latex,line join=bevel,]\n%%\n\\node (1) at
> (6bp,7bp) [draw,draw=none] {$1$};\n  \\node (0) at (6bp,57bp)
> [draw,draw=none] {$0$};\n  \\draw [black,->] (0) ..controls
> (6bp,44.053bp) and (6bp,33.103bp)  .. (1);\n%\n\\end{tikzpicture}\n'
> sage: opts.set_options(edge_labels=True)
> sage: opts.dot2tex_picture()
> ERROR    Failed to process input
> Traceback (most recent call last):
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 2939, in main
>     s =  conv.convert(dotdata)
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 794, in convert
>     return self.do_preview_preproc()
>   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
> packages/dot2tex/dot2tex.py", line 1167, in do_preview_preproc
>     hp,dp,wt = pp.texdims[name]
> KeyError: '010'
> ''
> }}}

New description:

 The following is ok :

 {{{
 sage: G = DiGraph()
 sage: G.add_edge(3333, 88, 'my_label')
 sage: G.set_latex_options(format='dot2tex')
 sage: view(G)
 }}}

 but with `edges_labels=True` a !KeyError is raised :

 {{{
 sage: G.set_latex_options(edge_labels=True)
 sage: view(G)
 ERROR    Failed to process input
 Traceback (most recent call last):
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 2939, in main
     s =  conv.convert(dotdata)
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 794, in convert
     return self.do_preview_preproc()
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 1167, in do_preview_preproc
     hp,dp,wt = pp.texdims[name]
 KeyError: '3333880'
 }}}

 The error is also raised by `dot2tex_picture` method:

 {{{
 sage: G = DiGraph()
 sage: G.add_edge(0, 1, 'p0')
 sage: G.latex_options().dot2tex_picture()
 '\n\\begin{tikzpicture}[>=latex,line join=bevel,]\n%%\n\\node (1) at
 (6bp,7bp) [draw,draw=none] {$1$};\n  \\node (0) at (6bp,57bp)
 [draw,draw=none] {$0$};\n  \\draw [black,->] (0) ..controls (6bp,44.053bp)
 and (6bp,33.103bp)  .. (1);\n%\n\\end{tikzpicture}\n'
 .dot2tex_picture()
 sage: G.set_latex_options(edge_labels=True)
 sage: G.latex_options().dot2tex_picture()
 ERROR    Failed to process input
 Traceback (most recent call last):
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 2939, in main
     s =  conv.convert(dotdata)
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 794, in convert
     return self.do_preview_preproc()
   File "/Users/slabbe/Applications/sage-5.2/local/lib/python2.7/site-
 packages/dot2tex/dot2tex.py", line 1167, in do_preview_preproc
     hp,dp,wt = pp.texdims[name]
 KeyError: '010'
 ''
 }}}

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13624#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to