Skip to content

Commit

Permalink
Trac #28759: py3: dot2tex + graphviz doctests failures
Browse files Browse the repository at this point in the history
{{{
sage -t --optional=sage,optional,external
src/sage/combinat/posets/posets.py  src/sage/graphs/graph_latex.py
}}}

gives

{{{
too many failed tests, not using stored timings
Running doctests with ID 2019-11-19-09-42-31-d56ff958.
Git branch: develop
Using --optional=4ti2,cbc,ccache,cryptominisat,dot2tex,e_antic,external,
glucose,latte_int,lidia,lrslib,memlimit,normaliz,notedown,openssl,
pandoc_attributes,pycosat,pynormaliz,rst2ipynb,sage,sagenb
External software to be detected:
cplex,ffmpeg,graphviz,gurobi,imagemagick,internet,latex,macaulay2,
magma,maple,mathematica,matlab,octave,pandoc,scilab
Doctesting 2 files.
sage -t src/sage/combinat/posets/posets.py
**********************************************************************
File "src/sage/combinat/posets/posets.py", line 1345, in
sage.combinat.posets.posets.FinitePoset._latex_
Failed example:
    print(P._latex_()) #optional - dot2tex graphviz
Expected:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_1) at (6.0...bp,5...bp) [draw,draw=none] {$2$};
      \node (node_0) at (6.0...bp,...bp) [draw,draw=none] {$1$};
      \draw [black,->] (node_0) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_1);
    %
    \end{tikzpicture}
Got:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_0) at (6.0bp,6.5bp) [draw,draw=none] {$1$};
      \node (node_1) at (6.0bp,55.5bp) [draw,draw=none] {$2$};
      \draw [black,->] (node_0) ..controls (6.0bp,19.603bp) and
(6.0bp,30.062bp)  .. (node_1);
    %
    \end{tikzpicture}
**********************************************************************
1 item had failures:
   1 of   3 in sage.combinat.posets.posets.FinitePoset._latex_
    [1354 tests, 1 failure, 8.11 s]
sage -t src/sage/graphs/graph_latex.py
**********************************************************************
File "src/sage/graphs/graph_latex.py", line 1333, in
sage.graphs.graph_latex.GraphLatex.dot2tex_picture
Failed example:
    print(g.latex_options().dot2tex_picture())  # optional - dot2tex
graphviz
Expected:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
      \node (node_3) at (...bp,...bp) [draw,draw=none] {$\left(0,
1\right)$};
      \node (node_2) at (...bp,...bp) [draw,draw=none] {$\left(1,
0\right)$};
      \node (node_1) at (...bp,...bp) [draw,draw=none] {$\left(0,
0\right)$};
      \node (node_0) at (...bp,...bp) [draw,draw=none] {$\left(1,
1\right)$};
      \draw [black,->] (node_1) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_3);
      \draw [black,->] (node_2) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_3);
      \draw [black,->] (node_2) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_0);
      \draw [black,->] (node_1) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_0);
    %
    \end{tikzpicture}
Got:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_0) at (14.5bp,8.5bp) [draw,draw=none] {$\left(0,
1\right)$};
      \node (node_1) at (14.5bp,61.5bp) [draw,draw=none] {$\left(0,
0\right)$};
      \node (node_3) at (61.5bp,8.5bp) [draw,draw=none] {$\left(1,
1\right)$};
      \node (node_2) at (61.5bp,61.5bp) [draw,draw=none] {$\left(1,
0\right)$};
      \draw [black,->] (node_1) ..controls (14.5bp,46.195bp) and
(14.5bp,35.966bp)  .. (node_0);
      \draw [black,->] (node_1) ..controls (28.308bp,45.517bp) and
(39.027bp,33.886bp)  .. (node_3);
      \draw [black,->] (node_2) ..controls (47.692bp,45.517bp) and
(36.973bp,33.886bp)  .. (node_0);
      \draw [black,->] (node_2) ..controls (61.5bp,46.195bp) and
(61.5bp,35.966bp)  .. (node_3);
    %
    \end{tikzpicture}
**********************************************************************
File "src/sage/graphs/graph_latex.py", line 1352, in
sage.graphs.graph_latex.GraphLatex.dot2tex_picture
Failed example:
    print(G.latex_options().dot2tex_picture()) # optional - dot2tex
graphviz
Expected:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_1) at (...bp,...bp) [draw,draw=none] {$3333$};
      \node (node_0) at (...bp,...bp) [draw,draw=none] {$88$};
      \draw [black,->] (node_1) ..controls (...bp,...bp) and
(...bp,...bp)  .. (node_0);
      \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
      \pgfsetstrokecolor{strokecol}
      \draw (...bp,...bp) node {$\text{\texttt{my{\char`\_}label}}$};
    %
    \end{tikzpicture}
Got:
    \begin{tikzpicture}[>=latex,line join=bevel,]
    %%
    \node (node_0) at (13.5bp,75.5bp) [draw,draw=none] {$3333$};
      \node (node_1) at (13.5bp,6.5bp) [draw,draw=none] {$88$};
      \draw [black,->] (node_0) ..controls (13.5bp,58.8bp) and
(13.5bp,37.836bp)  .. (node_1);
      \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
      \pgfsetstrokecolor{strokecol}
      \draw (40.0bp,41.0bp) node {$\text{\texttt{my{\char`\_}label}}$};
    %
    \end{tikzpicture}
**********************************************************************
1 item had failures:
   2 of  12 in sage.graphs.graph_latex.GraphLatex.dot2tex_picture
    [199 tests, 2 failures, 2.22 s]
----------------------------------------------------------------------
sage -t src/sage/combinat/posets/posets.py  # 1 doctest failed
sage -t src/sage/graphs/graph_latex.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 10.6 seconds
    cpu time: 8.1 seconds
    cumulative wall time: 10.3 seconds
External software detected for doctesting: graphviz
}}}

URL: https://trac.sagemath.org/28759
Reported by: slabbe
Ticket author(s): Frédéric Chapoton
Reviewer(s): Sébastien Labbé
  • Loading branch information
Release Manager committed Nov 28, 2019
2 parents 1dd5565 + b0e1893 commit cdda9f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/sage/combinat/posets/posets.py
Expand Up @@ -1345,9 +1345,9 @@ def _latex_(self):
sage: print(P._latex_()) #optional - dot2tex graphviz
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\node (node_1) at (6.0...bp,5...bp) [draw,draw=none] {$2$};
\node (node_0) at (6.0...bp,...bp) [draw,draw=none] {$1$};
\draw [black,->] (node_0) ..controls (...bp,...bp) and (...bp,...bp) .. (node_1);
\node (node_...) at (6.0...bp,...bp) [draw,draw=none] {$...$};
\node (node_...) at (6.0...bp,...bp) [draw,draw=none] {$...$};
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
%
\end{tikzpicture}
"""
Expand Down
23 changes: 11 additions & 12 deletions src/sage/graphs/graph_latex.py
Expand Up @@ -1333,14 +1333,14 @@ def dot2tex_picture(self):
sage: print(g.latex_options().dot2tex_picture()) # optional - dot2tex graphviz
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\node (node_3) at (...bp,...bp) [draw,draw=none] {$\left(0, 1\right)$};
\node (node_2) at (...bp,...bp) [draw,draw=none] {$\left(1, 0\right)$};
\node (node_1) at (...bp,...bp) [draw,draw=none] {$\left(0, 0\right)$};
\node (node_0) at (...bp,...bp) [draw,draw=none] {$\left(1, 1\right)$};
\draw [black,->] (node_1) ..controls (...bp,...bp) and (...bp,...bp) .. (node_3);
\draw [black,->] (node_2) ..controls (...bp,...bp) and (...bp,...bp) .. (node_3);
\draw [black,->] (node_2) ..controls (...bp,...bp) and (...bp,...bp) .. (node_0);
\draw [black,->] (node_1) ..controls (...bp,...bp) and (...bp,...bp) .. (node_0);
\node (node_...) at (...bp,...bp) [draw,draw=none] {$\left(...\right)$};
\node (node_...) at (...bp,...bp) [draw,draw=none] {$\left(...\right)$};
\node (node_...) at (...bp,...bp) [draw,draw=none] {$\left(...\right)$};
\node (node_...) at (...bp,...bp) [draw,draw=none] {$\left(...\right)$};
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
%
\end{tikzpicture}
Expand All @@ -1352,9 +1352,9 @@ def dot2tex_picture(self):
sage: print(G.latex_options().dot2tex_picture()) # optional - dot2tex graphviz
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\node (node_1) at (...bp,...bp) [draw,draw=none] {$3333$};
\node (node_0) at (...bp,...bp) [draw,draw=none] {$88$};
\draw [black,->] (node_1) ..controls (...bp,...bp) and (...bp,...bp) .. (node_0);
\node (node_...) at (...bp,...bp) [draw,draw=none] {$...$};
\node (node_...) at (...bp,...bp) [draw,draw=none] {$...$};
\draw [black,->] (node_...) ..controls (...bp,...bp) and (...bp,...bp) .. (node_...);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (...bp,...bp) node {$\text{\texttt{my{\char`\_}label}}$};
Expand All @@ -1372,7 +1372,6 @@ def dot2tex_picture(self):
...
\end{tikzpicture}
.. NOTE::
There is a lot of overlap between what ``tkz_picture`` and
Expand Down

0 comments on commit cdda9f7

Please sign in to comment.