astrofrog / mpl-scatter-density

:zap: Fast scatter density plots for Matplotlib :zap:
BSD 2-Clause "Simplified" License
497 stars 25 forks source link

FAILED mpl_scatter_density/tests/test_scatter_density_artist.py::TestScatterDensity::test_default_dpi #42

Open Hellseher opened 1 month ago

Hellseher commented 1 month ago

Hi,

While preparing glue-core for Guix which has mpl-scatter-density as an input, I've faced with one unit tests has failed:

=================================== FAILURES ===================================
_____________________ TestScatterDensity.test_default_dpi ______________________

self = <mpl_scatter_density.tests.test_scatter_density_artist.TestScatterDensity object at 0x7ffff2f92800>
tmpdir = local('/tmp/guix-build-python-mpl-scatter-density-0.7.drv-0/pytest-of-nixbld/pytest-0/test_default_dpi0')

    def test_default_dpi(self, tmpdir):

        self.fig.set_dpi(90)
        a = ScatterDensityArtist(self.ax, self.x1, self.y1, dpi=None)
        self.ax.add_artist(a)
        # We can't just draw, we need to save, as not all backends actually
        # draw when calling figure.canvas.draw()
        self.ax.figure.savefig(tmpdir.join('test.png').strpath)
>       assert a.get_size() == (216, 216)
E       assert (240, 240) == (216, 216)
E         At index 0 diff: 240 != 216
E         Full diff:
E         - (216, 216)
E         + (240, 240)

mpl_scatter_density/tests/test_scatter_density_artist.py:227: AssertionError
=============================== warnings summary ===============================
../../../gnu/store/8b5vqbb116yy3qjdc9sfvd1yb6klclgj-python-setuptools-67.6.1/lib/python3.10/site-packages/pkg_resources/__init__.py:121
  /gnu/store/8b5vqbb116yy3qjdc9sfvd1yb6klclgj-python-setuptools-67.6.1/lib/python3.10/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)

mpl_scatter_density/tests/__init__.py:7
  /tmp/guix-build-python-mpl-scatter-density-0.7.drv-0/mpl-scatter-density-0.7/mpl_scatter_density/tests/__init__.py:7: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    MPL_VERSION = LooseVersion(matplotlib.__version__)

mpl_scatter_density/tests/__init__.py:11
  /tmp/guix-build-python-mpl-scatter-density-0.7.drv-0/mpl-scatter-density-0.7/mpl_scatter_density/tests/__init__.py:11: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if MPL_VERSION >= LooseVersion('2'):  # pragma: nocover

mpl_scatter_density/tests/test_scatter_density_artist.py: 24 warnings
mpl_scatter_density/tests/test_scatter_density_axes.py: 2 warnings
  /tmp/guix-build-python-mpl-scatter-density-0.7.drv-0/mpl-scatter-density-0.7/mpl_scatter_density/generic_density_artist.py:77: RuntimeWarning: All-NaN slice encountered
    vmin = self._density_vmin(array)

mpl_scatter_density/tests/test_scatter_density_artist.py: 24 warnings
mpl_scatter_density/tests/test_scatter_density_axes.py: 2 warnings
  /tmp/guix-build-python-mpl-scatter-density-0.7.drv-0/mpl-scatter-density-0.7/mpl_scatter_density/generic_density_artist.py:82: RuntimeWarning: All-NaN slice encountered
    vmax = self._density_vmax(array)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED mpl_scatter_density/tests/test_scatter_density_artist.py::TestScatterDensity::test_default_dpi
============= 1 failed, 29 passed, 3 skipped, 55 warnings in 3.16s =============

Inputs: