#15225: dot2tex breaks Poset.show()
--------------------------------------+---------------------------
       Reporter:  jmantysalo          |        Owner:
           Type:  defect              |       Status:  needs_work
       Priority:  minor               |    Milestone:  sage-5.13
      Component:  packages: optional  |   Resolution:
       Keywords:  poset, dot2tex      |    Merged in:
        Authors:                      |    Reviewers:
Report Upstream:  N/A                 |  Work issues:  fix dot2tex
         Branch:                      |       Commit:
   Dependencies:                      |     Stopgaps:
--------------------------------------+---------------------------

Comment (by strogdon):

 The ValueError/AttributeError disappears for me if I include the
 
[https://code.google.com/p/dot2tex/source/diff?spec=svn681c5a92ec1604f6810dbe88b916f082a4ed6a44&old=7395e5a250800a174c86e3b9bf9435ca5d7618ef&r=681c5a92ec1604f6810dbe88b916f082a4ed6a44&format=unidiff&path=%2Fdot2tex%2Fdot2tex.py
 dot2tex patch] which seems to be present in the spkg(s) at ticket #14408.
 However, perhaps the real issue is that {{{prog='dot'}}} returns sometimes
 ints and sometimes floats for the positions. For example, with the patch:
 {{{
 sage: import dot2tex
 sage: AA = 'digraph {\n  "0" [label="0"];\n  "1" [label="1"];\n  "2"
 [label="2"];\n  "3" [label="3"];\n  "4" [label="4"];\n  "5" [label="5"];\n
 "6" [label="6"];\n  "7" [label="7"];\n  "8" [label="8"];\n  "9"
 [label="9"];\n  "10" [label="10"];\n\nedge [color="black"];\n  "0" ->
 "1";\n  "0" -> "3";\n  "0" -> "6";\n  "1" -> "2";\n  "1" -> "5";\n  "2" ->
 "7";\n  "3" -> "4";\n  "3" -> "8";\n  "4" -> "5";\n  "5" -> "9";\n  "6" ->
 "7";\n  "6" -> "8";\n  "7" -> "9";\n  "8" -> "9";\n}'
 sage: dot2tex.dot2tex(AA, format="positions", prog="dot")
 {'0': [113.39, 315.0],
  '1': [41.39, 241.0],
  '10': [185.39, 315.0],
  '2': [41.39, 167.0],
  '3': [113.39, 241.0],
  '4': [113.39, 167.0],
  '5': [113.39, 93.0],
  '6': [185.39, 241.0],
  '7': [231.39, 93.0],
  '8': [185.39, 167.0],
  '9': [176.39, 19.0]}
 sage: BB = 'digraph {\n  "0" [label="0"];\n  "1" [label="1"];\n  "2"
 [label="2"];\n  "3" [label="3"];\n  "4" [label="4"];\n  "5" [label="5"];\n
 "6" [label="6"];\n  "7" [label="7"];\n  "8" [label="8"];\n  "9"
 [label="9"];\n  "10" [label="10"];\n\nedge [color="black"];\n  "0" ->
 "1";\n  "0" -> "3";\n  "0" -> "6";\n  "1" -> "2";\n  "1" -> "5";\n  "2" ->
 "7";\n  "3" -> "4";\n  "3" -> "8";\n  "4" -> "5";\n  "5" -> "9";\n  "6" ->
 "7";\n  "6" -> "8";\n  "7" -> "9";\n}'
 sage: dot2tex.dot2tex(BB, format="positions", prog="dot")
 {'0': [137, 315],
  '1': [209, 241],
  '10': [209, 315],
  '2': [247, 167],
  '3': [65, 241],
  '4': [27, 167],
  '5': [128, 93],
  '6': [137, 241],
  '7': [200, 93],
  '8': [99, 167],
  '9': [164, 19]}
 }}}
 The first example gives a ValueError without the patch. This can be
 reproduced from python, so it's not Sage-specific. I suppose what's
 returned by {{{prog='dot'}}} should either be always ints or always floats
 for the positions, but I'm not sure whether the present situation is a bug
 or a feature, nor is it clear to me which calls in dot2tex produce these
 values.

--
Ticket URL: <http://trac.sagemath.org/ticket/15225#comment:16>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to