numerous pytest errors on python-3.9.9 and matplotlib-3.5.0
steven-omaha opened this issue · comments
steven-omaha commented
- Arch Linux
- all updates installed
python-3.9.9
matplotlib-3.5.0
- tested against 1e30229
output of pytest
$ pytest .
============================= test session starts ==============================
platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
Using --randomly-seed=482721266
rootdir: /tmp/makepkg/tikzplotlib
plugins: randomly-3.9.0, timeout-1.4.2
collected 108 items
tests/test_viridis.py . [ 0%]
tests/test_fancybox.py . [ 1%]
tests/test_errorband.py . [ 2%]
tests/test_horizontal_alignment.py . [ 3%]
tests/test_subplots.py . [ 4%]
tests/test_boxplot.py . [ 5%]
tests/test_patch_styles.py . [ 6%]
tests/test_context.py . [ 7%]
tests/test_colorbars.py F [ 8%]
tests/test_barchart.py . [ 9%]
tests/test_legend_columns.py . [ 10%]
tests/test_barchart_legend.py . [ 11%]
tests/test_deterministic_output.py . [ 12%]
tests/test_dual_axis.py . [ 12%]
tests/test_steps.py . [ 13%]
tests/test_marker.py . [ 14%]
tests/test_errorbar.py . [ 15%]
tests/test_pandas_dataframe.py . [ 16%]
tests/test_legend_line_scatter.py . [ 17%]
tests/test_scatter.py . [ 18%]
tests/test_hatch.py . [ 19%]
tests/test_fillstyle.py . [ 20%]
tests/test_tick_positions.py . [ 21%]
tests/test_basic_sin.py . [ 22%]
tests/test_line_color_marker.py . [ 23%]
tests/test_legends.py . [ 24%]
tests/test_noise2.py F [ 25%]
tests/test_image_plot_lower.py F [ 25%]
tests/test_escape_chars.py . [ 26%]
tests/test_custom_collection.py . [ 27%]
tests/test_loglogplot.py . [ 28%]
tests/test_legends2.py . [ 29%]
tests/test_barchart_errorbars.py F [ 30%]
tests/test_subplot4x4.py . [ 31%]
tests/test_axvline.py . [ 32%]
tests/test_subplots_with_colorbars.py s [ 33%]
tests/test_line_dashes.py . [ 34%]
tests/test_rotated_labels.py ................... [ 51%]
tests/test_line_collection.py F [ 52%]
tests/test_cleanfigure.py ............................. [ 79%]
tests/test_patches.py F [ 80%]
tests/test_externalize_tables.py . [ 81%]
tests/test_text_overlay.py F [ 82%]
tests/test_scatter_different_colors.py . [ 83%]
tests/test_legend_best_location.py s [ 84%]
tests/test_logplot_base.py . [ 85%]
tests/test_heat.py F [ 86%]
tests/test_line_set_data.py . [ 87%]
tests/test_noise.py F [ 87%]
tests/test_logplot.py . [ 88%]
tests/test_datetime.py . [ 89%]
tests/test_datetime_paths.py F [ 90%]
tests/test_scatter_different_sizes.py . [ 91%]
tests/test_fancy_colorbar.py F [ 92%]
tests/test_legend_labels.py . [ 93%]
tests/test_contourf.py . [ 94%]
tests/test_image_plot_upper.py s [ 95%]
tests/test_annotate.py . [ 96%]
tests/test_scatter_colormap.py . [ 97%]
tests/test_sharex_and_y.py . [ 98%]
tests/test_histogram.py . [ 99%]
tests/test_quadmesh.py . [100%]
=================================== FAILURES ===================================
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, "test_colorbars_reference.tex", assert_compilation=False)
tests/test_colorbars.py:78:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2fcf9d0>
filename = 'test_colorbars_reference.tex', assert_compilation = False
flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{groupplot}[group style={group size=1 by 3}]\n\\nextgroupplot[\ntick align=outside,\nt...cludegraphics cmd=\\pgfimage,xmin=-1, xmax=1, ymin=0, ymax=1] {tmp-002.png};\n\\end{groupplot}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_colorbars_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{groupplot}[group style={group size=1 by 3}]\n\\nextgroupplot[\ntick align=outside,\nt...graphics cmd=\\pgfimage,xmin=-1.5, xmax=1.5, ymin=-1, ymax=1] {tmp-002.png};\n\\end{groupplot}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: test_colorbars_reference.tex
E ---
E +++
E @@ -8,62 +8,53 @@
E xlabel={Some Units},
E xmin=-5, xmax=10,
E xtick style={color=black},
E -ymin=-5, ymax=10
E +ymin=0, ymax=1
E ]
E \path [draw=white, fill=white, line width=0.004pt]
E -(axis cs:-5,-5)
E ---(axis cs:-4.9414062,-5)
E ---(axis cs:9.9414062,-5)
E ---(axis cs:10,-5)
E ---(axis cs:10,10)
E ---(axis cs:9.9414062,10)
E ---(axis cs:-4.9414062,10)
E ---(axis cs:-5,10)
E ---(axis cs:-5,10)
E ---cycle;
E -\addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=-5, ymax=10] {tmp-000.png};
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=-5, xmax=10, ymin=0, ymax=1] {tmp-000.png};
E
E \nextgroupplot[
E tick align=outside,
E tick pos=left,
E x grid style={white!69.019608!black},
E xlabel={Discrete intervals, some other units},
E -xmin=0.65, xmax=8.35,
E +xmin=1, xmax=8,
E xtick style={color=black},
E -ymin=1, ymax=8
E +ymin=0, ymax=1
E ]
E \path [draw=white, fill=white, line width=0.004pt]
E -(axis cs:0.65,4.5)
E ---(axis cs:1,1)
E ---(axis cs:8,1)
E ---(axis cs:8.35,4.5)
E ---(axis cs:8.35,4.5)
E ---(axis cs:8,8)
E ---(axis cs:1,8)
E ---(axis cs:0.65,4.5)
E ---cycle;
E -\addplot graphics [includegraphics cmd=\pgfimage,xmin=0.65, xmax=8.35, ymin=1, ymax=8] {tmp-001.png};
E +;
E +\path [draw=black, fill=lightgray, line width=0pt]
E +(axis cs:0,0)
E +--(axis cs:-0.05,0.5)
E +--(axis cs:0,1);
E +\path [draw=black, fill=darkgray, line width=0pt]
E +(axis cs:1,0)
E +--(axis cs:1.05,0.5)
E +--(axis cs:1,1);
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=1, xmax=8, ymin=0, ymax=1] {tmp-001.png};
E
E \nextgroupplot[
E tick align=outside,
E tick pos=left,
E x grid style={white!69.019608!black},
E xlabel={Custom extension lengths, some other units},
E -xmin=-1.5, xmax=1.5,
E +xmin=-1, xmax=1,
E xtick style={color=black},
E -ymin=-1, ymax=1
E +ymin=0, ymax=1
E ]
E \path [draw=white, fill=white, line width=0.004pt]
E -(axis cs:-1.5,0)
E ---(axis cs:-1,-1)
E ---(axis cs:1,-1)
E ---(axis cs:1.5,0)
E ---(axis cs:1.5,0)
E ---(axis cs:1,1)
E ---(axis cs:-1,1)
E ---(axis cs:-1.5,0)
E ---cycle;
E -\addplot graphics [includegraphics cmd=\pgfimage,xmin=-1.5, xmax=1.5, ymin=-1, ymax=1] {tmp-002.png};
E +;
E +\path [draw=black, fill=blue, line width=0pt]
E +(axis cs:0,0)
E +--(axis cs:-0.25,0.5)
E +--(axis cs:0,1);
E +\path [draw=black, fill=red, line width=0pt]
E +(axis cs:1,0)
E +--(axis cs:1.25,0.5)
E +--(axis cs:1,1);
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=-1, xmax=1, ymin=0, ymax=1] {tmp-002.png};
E \end{groupplot}
E
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_noise2.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2f9c4c0>
filename = '/tmp/makepkg/tikzplotlib/tests/test_noise2_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar horizontal,\ncolorbar style={xtick={-1,0,1},xticklabels={Low,Medium,...s [includegraphics cmd=\\pgfimage,xmin=-1, xmax=1, ymin=0, ymax=1] {tmp-001.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_noise2_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar horizontal,\ncolorbar style={xtick={-1,0,1},xticklabels={Low,Medium,...phics cmd=\\pgfimage,xmin=-0.5, xmax=249.5, ymin=249.5, ymax=-0.5] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_noise2_reference.tex
E ---
E +++
E @@ -20,4 +20,19 @@
E \addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=249.5, ymin=249.5, ymax=-0.5] {tmp-000.png};
E \end{axis}
E
E +\begin{axis}[
E +tick align=outside,
E +tick pos=left,
E +x grid style={white!69.019608!black},
E +xmin=-1, xmax=1,
E +xtick style={color=black},
E +xtick={-1,0,1},
E +xticklabels={Low,Medium,{High,Higher}},
E +ymin=0, ymax=1
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=-1, xmax=1, ymin=0, ymax=1] {tmp-001.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, "test_image_plot_lower_reference.tex")
tests/test_image_plot_lower.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2ff18b0>
filename = 'test_image_plot_lower_reference.tex', assert_compilation = False
flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/viridis,\nhide x axis,\nhide...s cmd=\\pgfimage,xmin=0, xmax=1, ymin=0.10196079, ymax=0.93333334] {tmp-001.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_image_plot_lower_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/viridis,\nhide x axis,\nhide...raphics cmd=\\pgfimage,xmin=-0.5, xmax=15.5, ymin=-0.5, ymax=15.5] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: test_image_plot_lower_reference.tex
E ---
E +++
E @@ -20,4 +20,20 @@
E \addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=15.5, ymin=-0.5, ymax=15.5] {tmp-000.png};
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ymin=0.10196079, ymax=0.93333334,
E +ytick pos=right,
E +ytick style={color=black},
E +yticklabel style={anchor=west}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=0.10196079, ymax=0.93333334] {tmp-001.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, "test_barchart_errorbars_reference.tex")
tests/test_barchart_errorbars.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f393e670>
filename = 'test_barchart_errorbars_reference.tex', assert_compilation = False
flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ntick align=outside,\ntick pos=left,\nx grid style={white!69.019608!black},\nx...=8, mark options={solid}, only marks]\ntable {%\n0.25 5.1\n1.25 3.2\n2.25 1.1\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_barchart_errorbars_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ntick align=outside,\ntick pos=left,\nx grid style={white!69.019608!black},\nx...=8, mark options={solid}, only marks]\ntable {%\n0.25 5.1\n1.25 3.2\n2.25 1.1\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: test_barchart_errorbars_reference.tex
E ---
E +++
E @@ -31,6 +31,18 @@
E (axis cs:1.75,2.5)
E --(axis cs:1.75,3.5);
E
E +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E +table {%
E +-0.25 0.9
E +0.75 1.8
E +1.75 2.5
E +};
E +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E +table {%
E +-0.25 1.1
E +0.75 2.2
E +1.75 3.5
E +};
E \path [draw=black, line width=2pt]
E (axis cs:0,2.6)
E --(axis cs:0,3.4);
E @@ -43,6 +55,18 @@
E (axis cs:2,3.5)
E --(axis cs:2,4.5);
E
E +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E +table {%
E +0 2.6
E +1 1.8
E +2 3.5
E +};
E +\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E +table {%
E +0 3.4
E +1 2.2
E +2 4.5
E +};
E \path [draw=black, line width=2pt]
E (axis cs:0.25,4.9)
E --(axis cs:0.25,5.1);
E @@ -55,30 +79,6 @@
E (axis cs:2.25,0.9)
E --(axis cs:2.25,1.1);
E
E -\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E -table {%
E --0.25 0.9
E -0.75 1.8
E -1.75 2.5
E -};
E -\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E -table {%
E --0.25 1.1
E -0.75 2.2
E -1.75 3.5
E -};
E -\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E -table {%
E -0 2.6
E -1 1.8
E -2 3.5
E -};
E -\addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E -table {%
E -0 3.4
E -1 2.2
E -2 4.5
E -};
E \addplot [line width=2pt, black, mark=-, mark size=8, mark options={solid}, only marks]
E table {%
E 0.25 4.9
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_line_collection.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2f99670>
filename = '/tmp/makepkg/tikzplotlib/tests/test_line_collection_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ncolorbar,\nco...cs [includegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=0, ymax=9] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_line_collection_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ncolorbar,\nco...:5,14)\n--(axis cs:6,15)\n--(axis cs:7,16)\n--(axis cs:8,17)\n--(axis cs:9,18);\n\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_line_collection_reference.tex
E ---
E +++
E @@ -140,4 +140,21 @@
E
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ylabel={Line Number},
E +ymin=0, ymax=9,
E +ytick pos=right,
E +ytick style={color=black},
E +yticklabel style={anchor=west}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=0, ymax=9] {tmp-000.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_patches.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f1362940>
filename = '/tmp/makepkg/tikzplotlib/tests/test_patches_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.241237,0.296485,0.539709}\n\\definecolor{color1}{rgb}{0.187231,0...ics cmd=\\pgfimage,xmin=0, xmax=1, ymin=12.062867, ymax=98.555979] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_patches_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.241237,0.296485,0.539709}\n\\definecolor{color1}{rgb}{0.187231,0...s:0.3,0.3)\n.. controls (axis cs:0.5,1) and (axis cs:1,0.8) .. (axis cs:0.8,0.3);\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_patches_reference.tex
E ---
E +++
E @@ -205,4 +205,20 @@
E .. controls (axis cs:0.5,1) and (axis cs:1,0.8) .. (axis cs:0.8,0.3);
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ymin=12.062867, ymax=98.555979,
E +ytick pos=right,
E +ytick style={color=black},
E +yticklabel style={anchor=west}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=12.062867, ymax=98.555979] {tmp-000.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_text_overlay.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f1385820>
filename = '/tmp/makepkg/tikzplotlib/tests/test_text_overlay_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{1,0.8,0.8}\n\\definecolor{color1}{rgb}{1,0.5,0.5}\n\\definecolor{c...n={zigzag,amplitude=0.5,segment length=3},\n text=blue,\n rotate=0.0\n]{test8};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_text_overlay_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\\definecolor{color1}{rgb}{1,0....n={zigzag,amplitude=0.5,segment length=3},\n text=blue,\n rotate=0.0\n]{test8};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_text_overlay_reference.tex
E ---
E +++
E @@ -1,8 +1,8 @@
E \begin{tikzpicture}
E
E -\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}
E -\definecolor{color1}{rgb}{1,0.8,0.8}
E -\definecolor{color2}{rgb}{1,0.5,0.5}
E +\definecolor{color0}{rgb}{1,0.8,0.8}
E +\definecolor{color1}{rgb}{1,0.5,0.5}
E +\definecolor{color2}{rgb}{0.12156863,0.46666667,0.70588235}
E
E \begin{axis}[
E legend cell align={left},
E @@ -23,7 +23,7 @@
E ymin=-1.25, ymax=26.25,
E ytick style={color=black}
E ]
E -\addplot [semithick, color0]
E +\addplot [semithick, color2]
E table {%
E 0 0
E 0.10204082 0.010412328
E @@ -79,8 +79,8 @@
E \addlegendentry{a graph}
E \draw (axis cs:1,5) node[
E scale=2.5,
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=2pt,
E rounded corners,
E @@ -91,16 +91,16 @@
E ]{\itshape test1};
E \draw (axis cs:3,6) node[
E scale=2.5,
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E text=blue,
E rotate=330.0
E ]{\bfseries test2};
E \draw (axis cs:4,8) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E single arrow,
E @@ -109,8 +109,8 @@
E rotate=90.0
E ]{\bfseries test3};
E \draw (axis cs:4,16) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E single arrow,
E @@ -120,8 +120,8 @@
E rotate=90.0
E ]{\bfseries test4};
E \draw (axis cs:2,18) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E double arrow,
E @@ -129,8 +129,8 @@
E rotate=0.0
E ]{test5};
E \draw (axis cs:1,20) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E circle,
E @@ -138,8 +138,8 @@
E rotate=0.0
E ]{test6};
E \draw (axis cs:3,23) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E decorate,
E @@ -148,8 +148,8 @@
E rotate=0.0
E ]{test7};
E \draw (axis cs:3,20) node[
E - fill=color1,
E - draw=color2,
E + fill=color0,
E + draw=color1,
E line width=0.4pt,
E inner sep=3pt,
E decorate,
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, "test_heat_reference.tex")
tests/test_heat.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2ff1280>, filename = 'test_heat_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/blackwhite,\npoint meta max=...ncludegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=-100, ymax=100] {tmp-001.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_heat_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/blackwhite,\npoint meta max=...cludegraphics cmd=\\pgfimage,xmin=-10, xmax=10, ymin=-10, ymax=10] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: test_heat_reference.tex
E ---
E +++
E @@ -18,4 +18,20 @@
E \addplot graphics [includegraphics cmd=\pgfimage,xmin=-10, xmax=10, ymin=-10, ymax=10] {tmp-000.png};
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ymin=-100, ymax=100,
E +ytick pos=right,
E +ytick style={color=black},
E +yticklabel style={anchor=west}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=-100, ymax=100] {tmp-001.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_noise.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2f9c280>
filename = '/tmp/makepkg/tikzplotlib/tests/test_noise_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ytick={-1,0,1},yticklabels={< -1,0,> 1},ylabel={}}...s [includegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=-1, ymax=1] {tmp-001.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_noise_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ytick={-1,0,1},yticklabels={< -1,0,> 1},ylabel={}}...phics cmd=\\pgfimage,xmin=-0.5, xmax=249.5, ymin=249.5, ymax=-0.5] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_noise_reference.tex
E ---
E +++
E @@ -20,4 +20,22 @@
E \addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=249.5, ymin=249.5, ymax=-0.5] {tmp-000.png};
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ymin=-1, ymax=1,
E +ytick pos=right,
E +ytick style={color=black},
E +ytick={-1,0,1},
E +yticklabel style={anchor=west},
E +yticklabels={< -1,0,> 1}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=-1, ymax=1] {tmp-001.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, __file__[:-3] + "_reference.tex")
tests/test_datetime_paths.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f393eb80>
filename = '/tmp/makepkg/tikzplotlib/tests/test_datetime_paths_reference.tex'
assert_compilation = False, flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ndate coordina...table [header=false,col sep=comma] {%\n2020-01-01 12:00,2\n2020-01-02 12:00,2\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_datetime_paths_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\definecolor{color0}{rgb}{0.12156863,0.46666667,0.70588235}\n\n\\begin{axis}[\ndate coordina...table [header=false,col sep=comma] {%\n2020-01-01 12:00,2\n2020-01-02 12:00,2\n};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: /tmp/makepkg/tikzplotlib/tests/test_datetime_paths_reference.tex
E ---
E +++
E @@ -14,12 +14,12 @@
E ytick style={color=black}
E ]
E \path [fill=color0]
E -(axis cs:2020-01-01 12:00:00+00:00,3)
E ---(axis cs:2020-01-01 12:00:00+00:00,1)
E ---(axis cs:2020-01-02 12:00:00+00:00,0)
E ---(axis cs:2020-01-02 12:00:00+00:00,4)
E ---(axis cs:2020-01-02 12:00:00+00:00,4)
E ---(axis cs:2020-01-01 12:00:00+00:00,3)
E +(axis cs:18262.5,3)
E +--(axis cs:18262.5,1)
E +--(axis cs:18263.5,0)
E +--(axis cs:18263.5,4)
E +--(axis cs:18263.5,4)
E +--(axis cs:18262.5,3)
E --cycle;
E
E \addplot [semithick, color0]
tests/helpers.py:48: AssertionError
_____________________________________ test _____________________________________
def test():
from .helpers import assert_equality
> assert_equality(plot, "test_fancy_colorbar_reference.tex")
tests/test_fancy_colorbar.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
plot = <function plot at 0x7fc3f2fe58b0>
filename = 'test_fancy_colorbar_reference.tex', assert_compilation = False
flavor = 'latex', extra_get_tikz_code_args = {}
code = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/viridis,\npoint meta max=1,\...cs [includegraphics cmd=\\pgfimage,xmin=0, xmax=1, ymin=0, ymax=1] {tmp-001.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
this_dir = PosixPath('/tmp/makepkg/tikzplotlib/tests')
f = <_io.TextIOWrapper name='/tmp/makepkg/tikzplotlib/tests/test_fancy_colorbar_reference.tex' mode='r' encoding='utf-8'>
reference = '\\begin{tikzpicture}\n\n\\begin{axis}[\ncolorbar,\ncolorbar style={ylabel={}},\ncolormap/viridis,\npoint meta max=1,\...egraphics cmd=\\pgfimage,xmin=-0.5, xmax=2.5, ymin=2.5, ymax=-0.5] {tmp-000.png};\n\\end{axis}\n\n\\end{tikzpicture}\n'
def assert_equality(
plot, filename, assert_compilation=False, flavor="latex", **extra_get_tikz_code_args
):
plot()
code = tikzplotlib.get_tikz_code(
include_disclaimer=False,
float_format=".8g",
flavor=flavor,
**extra_get_tikz_code_args,
)
plt.close()
this_dir = pathlib.Path(__file__).resolve().parent
with open(this_dir / filename, encoding="utf-8") as f:
reference = f.read()
> assert reference == code, filename + "\n" + _unidiff_output(reference, code)
E AssertionError: test_fancy_colorbar_reference.tex
E ---
E +++
E @@ -19,4 +19,20 @@
E \addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=2.5, ymin=2.5, ymax=-0.5] {tmp-000.png};
E \end{axis}
E
E +\begin{axis}[
E +axis y line=right,
E +tick align=outside,
E +xmin=0, xmax=1,
E +xtick pos=left,
E +y grid style={white!69.019608!black},
E +ymin=0, ymax=1,
E +ytick pos=right,
E +ytick style={color=black},
E +yticklabel style={anchor=west}
E +]
E +\path [draw=white, fill=white, line width=0.004pt]
E +;
E +\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=0, ymax=1] {tmp-001.png};
E +\end{axis}
E +
E \end{tikzpicture}
tests/helpers.py:48: AssertionError
=============================== warnings summary ===============================
tests/test_logplot_base.py::test
/tmp/makepkg/tikzplotlib/tests/test_logplot_base.py:9: MatplotlibDeprecationWarning: The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
plt.grid(b=True, which="major", color="g", linestyle="-", linewidth=0.25)
tests/test_logplot_base.py::test
/tmp/makepkg/tikzplotlib/tests/test_logplot_base.py:10: MatplotlibDeprecationWarning: The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
plt.grid(b=True, which="minor", color="r", linestyle="--", linewidth=0.5)
tests/test_logplot.py::test
/tmp/makepkg/tikzplotlib/tests/test_logplot.py:10: MatplotlibDeprecationWarning: The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
plt.grid(b=True, which="major", color="g", linestyle="-", linewidth=0.25)
tests/test_logplot.py::test
/tmp/makepkg/tikzplotlib/tests/test_logplot.py:11: MatplotlibDeprecationWarning: The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
plt.grid(b=True, which="minor", color="r", linestyle="--", linewidth=0.5)
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_colorbars.py::test - AssertionError: test_colorbars_referen...
FAILED tests/test_noise2.py::test - AssertionError: /tmp/makepkg/tikzplotlib/...
FAILED tests/test_image_plot_lower.py::test - AssertionError: test_image_plot...
FAILED tests/test_barchart_errorbars.py::test - AssertionError: test_barchart...
FAILED tests/test_line_collection.py::test - AssertionError: /tmp/makepkg/tik...
FAILED tests/test_patches.py::test - AssertionError: /tmp/makepkg/tikzplotlib...
FAILED tests/test_text_overlay.py::test - AssertionError: /tmp/makepkg/tikzpl...
FAILED tests/test_heat.py::test - AssertionError: test_heat_reference.tex
FAILED tests/test_noise.py::test - AssertionError: /tmp/makepkg/tikzplotlib/t...
FAILED tests/test_datetime_paths.py::test - AssertionError: /tmp/makepkg/tikz...
FAILED tests/test_fancy_colorbar.py::test - AssertionError: test_fancy_colorb...
============ 11 failed, 94 passed, 3 skipped, 4 warnings in 12.77s =============
Nico Schlömer commented
Fixed now.
steven-omaha commented
Thanks!