Skip to content

Commit

Permalink
MNT: Updating to MPL 3.2 minimum
Browse files Browse the repository at this point in the history
Pin minimum CI to 3.2.1 because that has the test label
at conda-forge which we need for the image tests. Remove other
image comparison checks for less than 3.2.
  • Loading branch information
greglucas committed Jan 28, 2022
1 parent 3ec31f8 commit 477e7f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest'
id: minimum-packages
run: |
echo "PACKAGES=cython=0.29.15 matplotlib=3.1 numpy=1.19 owslib=0.19.1 pyproj=3.0 proj=8.0 scipy=1.4.0 shapely=1.6.4" >> $GITHUB_ENV
echo "PACKAGES=cython=0.29.15 matplotlib-base=3.2.1 numpy=1.19 owslib=0.19.1 pyproj=3.0 proj=8.0 scipy=1.4.0 shapely=1.6.4" >> $GITHUB_ENV
- name: Latest packages
if: steps.minimum-packages.conclusion == 'skipped'
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Further information about the required dependencies can be found here:
**Python** 3.8 or later (https://www.python.org/)
Python 2 support was removed in v0.19.

**Matplotlib** 3.1 or later (https://matplotlib.org/)
**Matplotlib** 3.2 or later (https://matplotlib.org/)
Python package for 2D plotting. Python package required for any
graphical capabilities.

Expand Down
3 changes: 1 addition & 2 deletions lib/cartopy/tests/mpl/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# licensing details.

import matplotlib.pyplot as plt
from packaging.version import parse as parse_version
import pytest

import cartopy.crs as ccrs
Expand Down Expand Up @@ -35,7 +34,7 @@ def test_global_map():
@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(filename='contour_label.png',
tolerance=(9.9
if MPL_VERSION < parse_version('3.2')
if MPL_VERSION.release[:2] < (3, 3)
else 0.5))
def test_contour_label():
from cartopy.tests.mpl.test_caching import sample_data
Expand Down
13 changes: 4 additions & 9 deletions lib/cartopy/tests/mpl/test_mpl_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import numpy as np
import matplotlib.pyplot as plt
from packaging.version import parse as parse_version
import pytest

import cartopy.crs as ccrs
Expand Down Expand Up @@ -110,9 +109,7 @@ def test_global_scatter_wrap_no_transform():


@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(
filename='global_hexbin_wrap.png',
tolerance=2 if MPL_VERSION < parse_version('3.2') else 0.5)
@pytest.mark.mpl_image_compare(filename='global_hexbin_wrap.png')
def test_global_hexbin_wrap():
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines(zorder=2)
Expand All @@ -131,7 +128,7 @@ def test_global_hexbin_wrap():
@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(
filename='global_hexbin_wrap.png',
tolerance=2 if MPL_VERSION < parse_version('3.2') else 0.5)
tolerance=0.5)
def test_global_hexbin_wrap_transform():
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines(zorder=2)
Expand Down Expand Up @@ -191,8 +188,7 @@ def test_simple_global():
id='TransverseMercator'),
])
@pytest.mark.mpl_image_compare(
tolerance=(2.61 if MPL_VERSION.release[:2] == (3, 1) else
0.97 if MPL_VERSION.release[:2] < (3, 5) else 0.5),
tolerance=0.97 if MPL_VERSION.release[:2] < (3, 5) else 0.5,
style='mpl20')
def test_global_map(proj):
if isinstance(proj, tuple):
Expand Down Expand Up @@ -844,8 +840,7 @@ def test_barbs_1d_transformed():
@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(
filename='streamplot.png', style='mpl20',
tolerance=(42 if MPL_VERSION.release[:2] < (3, 2) else
9.77 if MPL_VERSION.release[:2] < (3, 5) else 0.5))
tolerance=9.77 if MPL_VERSION.release[:2] < (3, 5) else 0.5)
def test_streamplot():
x = np.arange(-60, 42.5, 2.5)
y = np.arange(30, 72.5, 2.5)
Expand Down

0 comments on commit 477e7f3

Please sign in to comment.