From 766e28039b67b0f15b0588c8feffc69205673d24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 12:25:14 +0000 Subject: [PATCH 1/2] CI: (deps): Bump cartopy from 0.21.1 to 0.22.0 in /ci Bumps [cartopy](https://github.com/SciTools/cartopy) from 0.21.1 to 0.22.0. - [Release notes](https://github.com/SciTools/cartopy/releases) - [Commits](https://github.com/SciTools/cartopy/compare/v0.21.1...v0.22.0) --- updated-dependencies: - dependency-name: cartopy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ci/extra_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/extra_requirements.txt b/ci/extra_requirements.txt index 69fa15bea40..a27cd8a5df2 100644 --- a/ci/extra_requirements.txt +++ b/ci/extra_requirements.txt @@ -1,2 +1,2 @@ -cartopy==0.21.1 +cartopy==0.22.0 shapely==2.0.1 From 09067cc80fd35c24ae482c288912445195d5ee6c Mon Sep 17 00:00:00 2001 From: Ryan May Date: Fri, 11 Aug 2023 15:27:35 -0600 Subject: [PATCH 2/2] MNT: Bump test tolerances for Cartopy 0.22 Looks like this version tweaked something that introduced very minor pixel changes that were causing failures. --- tests/plots/test_declarative.py | 34 ++++++++++++++++---------------- tests/plots/test_plot_areas.py | 10 +++++----- tests/plots/test_station_plot.py | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py index ec666e757ef..728978f39c7 100644 --- a/tests/plots/test_declarative.py +++ b/tests/plots/test_declarative.py @@ -24,7 +24,7 @@ from metpy.units import units -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.005) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02) @needs_cartopy def test_declarative_image(): """Test making an image plot.""" @@ -221,7 +221,7 @@ def test_declarative_smooth_contour_calculation(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.01) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.021) @needs_cartopy def test_declarative_smooth_contour_order(): """Test making a contour plot using smooth_contour with tuple.""" @@ -334,7 +334,7 @@ def test_declarative_contour_cam(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.03) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.036) @needs_cartopy def test_declarative_contour_options(): """Test making a contour plot.""" @@ -364,7 +364,7 @@ def test_declarative_contour_options(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.08) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.082) @needs_cartopy def test_declarative_layers_plot_options(): """Test making a contour plot.""" @@ -394,7 +394,7 @@ def test_declarative_layers_plot_options(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.0152) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.025) @needs_cartopy def test_declarative_contour_convert_units(): """Test making a contour plot.""" @@ -468,7 +468,7 @@ def test_declarative_events(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.009) @needs_cartopy def test_declarative_raster_events(): """Test that resetting traitlets properly propagates in RasterPlot().""" @@ -589,7 +589,7 @@ def test_projection_object(ccrs, cfeature): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.009) def test_colorfill(cfeature): """Test that we can use ContourFillPlot.""" data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)) @@ -614,7 +614,7 @@ def test_colorfill(cfeature): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.0062) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02) def test_colorfill_with_image_range(cfeature): """Test that we can use ContourFillPlot with image_range bounds.""" data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)) @@ -641,7 +641,7 @@ def test_colorfill_with_image_range(cfeature): @pytest.mark.mpl_image_compare( - remove_text=True, tolerance=0.0062, filename='test_colorfill_with_image_range.png' + remove_text=True, tolerance=0.02, filename='test_colorfill_with_image_range.png' ) def test_colorfill_with_normalize_instance_image_range(cfeature): """Test that we can use ContourFillPlot with image_range bounds.""" @@ -668,7 +668,7 @@ def test_colorfill_with_normalize_instance_image_range(cfeature): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02) def test_colorfill_horiz_colorbar(cfeature): """Test that we can use ContourFillPlot with a horizontal colorbar.""" data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)) @@ -693,7 +693,7 @@ def test_colorfill_horiz_colorbar(cfeature): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.0062) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02) def test_colorfill_no_colorbar(cfeature): """Test that we can use ContourFillPlot with no colorbar.""" data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)) @@ -771,7 +771,7 @@ def test_latlon(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.292) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.293) @needs_cartopy def test_declarative_barb_options(): """Test making a contour plot.""" @@ -891,7 +891,7 @@ def test_declarative_arrow_changes(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.5) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.51) @needs_cartopy def test_declarative_barb_earth_relative(): """Test making a contour plot.""" @@ -969,7 +969,7 @@ def test_declarative_overlay_projections(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.021) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.026) @needs_cartopy def test_declarative_gridded_scale(): """Test making a contour plot.""" @@ -1217,7 +1217,7 @@ def test_plotobs_subset_time_window_level(sample_obs): pd.testing.assert_frame_equal(obs.obsdata, truth) -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.016) def test_plotobs_units_with_formatter(ccrs): """Test using PlotObs with a field that both has units and a custom formatter.""" df = pd.read_csv(get_test_data('SFC_obs.csv', as_file_obj=False), @@ -1285,7 +1285,7 @@ def test_declarative_sfc_obs(ccrs): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.016) @needs_cartopy def test_declarative_sfc_text(): """Test making a surface observation plot with text.""" @@ -1760,7 +1760,7 @@ def test_declarative_contour_label_fontsize(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02) @needs_cartopy def test_declarative_raster(): """Test making a raster plot.""" diff --git a/tests/plots/test_plot_areas.py b/tests/plots/test_plot_areas.py index 662831c3d6a..6328bcb88a3 100644 --- a/tests/plots/test_plot_areas.py +++ b/tests/plots/test_plot_areas.py @@ -7,7 +7,7 @@ import pytest -@pytest.mark.mpl_image_compare(tolerance=0.005) +@pytest.mark.mpl_image_compare(tolerance=0.023) def test_uslcc_plotting(ccrs, cfeature): """Test plotting the uslcc area with projection.""" from metpy.plots import named_areas @@ -27,7 +27,7 @@ def test_uslcc_plotting(ccrs, cfeature): return fig -@pytest.mark.mpl_image_compare(tolerance=0.005) +@pytest.mark.mpl_image_compare(tolerance=0.016) def test_au_plotting(ccrs, cfeature): """Test plotting the au area with projection.""" from metpy.plots import named_areas @@ -47,7 +47,7 @@ def test_au_plotting(ccrs, cfeature): return fig -@pytest.mark.mpl_image_compare(tolerance=0.008) +@pytest.mark.mpl_image_compare(tolerance=0.017) def test_cn_plotting(ccrs, cfeature): """Test plotting the cn area with projection.""" from metpy.plots import named_areas @@ -67,7 +67,7 @@ def test_cn_plotting(ccrs, cfeature): return fig -@pytest.mark.mpl_image_compare(tolerance=0.005) +@pytest.mark.mpl_image_compare(tolerance=0.016) def test_hi_plotting(ccrs, cfeature): """Test plotting the hi area with projection.""" from metpy.plots import named_areas @@ -87,7 +87,7 @@ def test_hi_plotting(ccrs, cfeature): return fig -@pytest.mark.mpl_image_compare(tolerance=0.005) +@pytest.mark.mpl_image_compare(tolerance=0.016) def test_wpac_plotting(ccrs, cfeature): """Test plotting the wpac area with projection.""" from metpy.plots import named_areas diff --git a/tests/plots/test_station_plot.py b/tests/plots/test_station_plot.py index 30c16f074e6..0a784207aa4 100644 --- a/tests/plots/test_station_plot.py +++ b/tests/plots/test_station_plot.py @@ -291,7 +291,7 @@ def test_barb_projection(wind_plot, ccrs): return fig -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.01) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.023) def test_arrow_projection(wind_plot, ccrs): """Test that arrows are properly projected.""" u, v, x, y = wind_plot