diff --git a/.codecov.yml b/.codecov.yml index 826bd9d12cf..42ffa6b6eb2 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,16 +7,10 @@ coverage: patch: default: target: '80' - if_no_uploads: error - if_not_found: success - if_ci_failed: failure project: - default: false library: target: auto - if_no_uploads: error - if_not_found: success - if_ci_failed: failure + threshold: 0.25% paths: - "src/metpy/.*" diff --git a/ci/Current.txt b/ci/Current.txt index eea254389d5..e2c07523e93 100644 --- a/ci/Current.txt +++ b/ci/Current.txt @@ -1,4 +1,4 @@ -matplotlib==3.2.1 +matplotlib==3.3.0 numpy==1.19.1 scipy==1.5.2 pint==0.14 diff --git a/src/metpy/plots/_mpl.py b/src/metpy/plots/_mpl.py index a7848c92022..084055111aa 100644 --- a/src/metpy/plots/_mpl.py +++ b/src/metpy/plots/_mpl.py @@ -225,8 +225,9 @@ def draw(self, renderer): if renderer.flipy(): y = canvash - y - # Can simplify next two lines once support for matplotlib<3.1 is dropped - check_line = getattr(self, '_preprocess_math', self.is_math_text) + # Can simplify next three lines once support for matplotlib<3.1 is dropped + is_math_text = getattr(self, 'is_math_text', False) + check_line = getattr(self, '_preprocess_math', is_math_text) clean_line, ismath = check_line(line) if self.get_path_effects(): diff --git a/src/metpy/plots/skewt.py b/src/metpy/plots/skewt.py index d8619de03a2..9d35cd161ae 100644 --- a/src/metpy/plots/skewt.py +++ b/src/metpy/plots/skewt.py @@ -8,6 +8,7 @@ """ from contextlib import ExitStack +import warnings import matplotlib from matplotlib.axes import Axes @@ -126,7 +127,11 @@ class SkewXAxis(maxis.XAxis): """ def _get_tick(self, major): - return SkewXTick(self.axes, None, '', major=major) + # Warning stuff can go away when we only support Matplotlib >=3.3 + with warnings.catch_warnings(): + warnings.simplefilter('ignore', getattr( + matplotlib, 'MatplotlibDeprecationWarning', DeprecationWarning)) + return SkewXTick(self.axes, None, label=None, major=major) # Needed to properly handle tight bbox def _get_tick_bboxes(self, ticks, renderer): diff --git a/src/metpy/testing.py b/src/metpy/testing.py index dc80b740972..cdd8d8a7eaa 100644 --- a/src/metpy/testing.py +++ b/src/metpy/testing.py @@ -199,17 +199,6 @@ def set_agg_backend(): plt.switch_backend(prev_backend) -@pytest.fixture(autouse=True) -def patch_round(monkeypatch): - """Fixture to patch builtin round using numpy's. - - This works around the fact that built-in round changed between Python 2 and 3. This - is probably not needed once we're testing on matplotlib 2.0, which has been updated - to use numpy's throughout. - """ - monkeypatch.setitem(__builtins__, 'round', np.round) - - def check_and_silence_warning(warn_type): """Decorate a function to swallow some warning type, making sure they are present. diff --git a/tests/plots/test_cartopy_utils.py b/tests/plots/test_cartopy_utils.py index db1cc727c7a..c753f062c74 100644 --- a/tests/plots/test_cartopy_utils.py +++ b/tests/plots/test_cartopy_utils.py @@ -10,7 +10,7 @@ from metpy.plots import USCOUNTIES, USSTATES # Fixtures to make sure we have the right backend and consistent round -from metpy.testing import patch_round, set_agg_backend # noqa: F401, I202 +from metpy.testing import set_agg_backend # noqa: F401, I202 MPL_VERSION = matplotlib.__version__[:3] diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py index c35aec3340a..78691d9abee 100644 --- a/tests/plots/test_declarative.py +++ b/tests/plots/test_declarative.py @@ -468,7 +468,7 @@ def test_declarative_gridded_scale(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.347) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.607) def test_declarative_barb_gfs(): """Test making a contour plot.""" data = xr.open_dataset(get_test_data('GFS_test.nc', as_file_obj=False)) @@ -496,7 +496,7 @@ def test_declarative_barb_gfs(): return pc.figure -@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.346) +@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.466) def test_declarative_barb_gfs_knots(): """Test making a contour plot.""" data = xr.open_dataset(get_test_data('GFS_test.nc', as_file_obj=False)) diff --git a/tests/plots/test_skewt.py b/tests/plots/test_skewt.py index 65980e460c6..21036fbc3d3 100644 --- a/tests/plots/test_skewt.py +++ b/tests/plots/test_skewt.py @@ -11,7 +11,7 @@ from metpy.plots import Hodograph, SkewT # Fixtures to make sure we have the right backend and consistent round -from metpy.testing import patch_round, set_agg_backend # noqa: F401, I202 +from metpy.testing import set_agg_backend # noqa: F401, I202 from metpy.units import units diff --git a/tests/plots/test_station_plot.py b/tests/plots/test_station_plot.py index 9da67af0fbf..0a49c98b97e 100644 --- a/tests/plots/test_station_plot.py +++ b/tests/plots/test_station_plot.py @@ -13,7 +13,7 @@ from metpy.plots import (current_weather, high_clouds, nws_layout, simple_layout, sky_cover, StationPlot, StationPlotLayout) # Fixtures to make sure we have the right backend and consistent round -from metpy.testing import patch_round, set_agg_backend # noqa: F401, I202 +from metpy.testing import set_agg_backend # noqa: F401, I202 from metpy.units import units