sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 482 forks source link

py3: dot2tex + graphviz doctests failures #28759

Closed seblabbe closed 4 years ago

seblabbe commented 4 years ago
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

Component: doctest coverage

Author: Frédéric Chapoton

Branch/Commit: b0e1893

Reviewer: Sébastien Labbé

Issue created by migration from https://trac.sagemath.org/ticket/28759

fchapoton commented 4 years ago

Description changed:

--- 
+++ 
@@ -9,8 +9,11 @@
 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
+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
 **********************************************************************
fchapoton commented 4 years ago
comment:2

We have random vertex order, so I just made the doctests more blurry.


New commits:

b0e1893trac 28759 py3 fix for dot2tex+graphviz
fchapoton commented 4 years ago

Author: Frédéric Chapoton

fchapoton commented 4 years ago

Branch: u/chapoton/28759

fchapoton commented 4 years ago

Commit: b0e1893

seblabbe commented 4 years ago

Reviewer: Sébastien Labbé

vbraun commented 4 years ago

Changed branch from u/chapoton/28759 to b0e1893