Skip to content

Commit

Permalink
MNT: Update some image tests for Matplotlib 3.8
Browse files Browse the repository at this point in the history
Looks like a minor bug in the contouring got fixed, which changed a few
of the contour lines slightly.
  • Loading branch information
dopplershift committed Sep 20, 2023
1 parent b227175 commit 52b090a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Binary file modified tests/plots/baseline/test_declarative_contour_convert_units.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plots/baseline/test_declarative_contour_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from metpy.io.metar import parse_metar_file
from metpy.plots import (ArrowPlot, BarbPlot, ContourPlot, FilledContourPlot, ImagePlot,
MapPanel, PanelContainer, PlotGeometry, PlotObs, RasterPlot)
from metpy.testing import needs_cartopy
from metpy.testing import needs_cartopy, mpl_version_before

Check failure on line 23 in tests/plots/test_declarative.py

View workflow job for this annotation

GitHub Actions / Flake8

[flake8] reported by reviewdog 🐶 I001 isort found an import in the wrong position Raw Output: ./tests/plots/test_declarative.py:23:1: I001 isort found an import in the wrong position
from metpy.units import units

Check failure on line 24 in tests/plots/test_declarative.py

View workflow job for this annotation

GitHub Actions / Flake8

[flake8] reported by reviewdog 🐶 I005 isort found an unexpected missing import Raw Output: ./tests/plots/test_declarative.py:24:1: I005 isort found an unexpected missing import


Expand Down Expand Up @@ -334,7 +334,8 @@ def test_declarative_contour_cam():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.036)
@pytest.mark.mpl_image_compare(remove_text=True,
tolerance=0 if mpl_version_before('3.8') else 0)
@needs_cartopy
def test_declarative_contour_options():
"""Test making a contour plot."""
Expand Down Expand Up @@ -394,7 +395,8 @@ def test_declarative_layers_plot_options():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.025)
@pytest.mark.mpl_image_compare(remove_text=True,
tolerance=0 if mpl_version_before('3.8') else 0)
@needs_cartopy
def test_declarative_contour_convert_units():
"""Test making a contour plot."""
Expand Down

0 comments on commit 52b090a

Please sign in to comment.