Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*"

Expand Down
2 changes: 1 addition & 1 deletion ci/Current.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
matplotlib==3.2.1
matplotlib==3.3.0
numpy==1.19.1
scipy==1.5.2
pint==0.14
Expand Down
5 changes: 3 additions & 2 deletions src/metpy/plots/_mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
7 changes: 6 additions & 1 deletion src/metpy/plots/skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

from contextlib import ExitStack
import warnings

import matplotlib
from matplotlib.axes import Axes
Expand Down Expand Up @@ -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):
Expand Down
11 changes: 0 additions & 11 deletions src/metpy/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_cartopy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_station_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down