From a4aeb54bd326ca8016b0bfe87b32229d888db3d3 Mon Sep 17 00:00:00 2001 From: Jon Thielen Date: Tue, 5 May 2020 19:34:59 -0500 Subject: [PATCH] Quick patch to bypass scale validation in new Cartopy --- src/metpy/plots/cartopy_utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/metpy/plots/cartopy_utils.py b/src/metpy/plots/cartopy_utils.py index 0140946f990..5620c38ab87 100644 --- a/src/metpy/plots/cartopy_utils.py +++ b/src/metpy/plots/cartopy_utils.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause """Cartopy specific mapping utilities.""" +import cartopy.crs as ccrs import cartopy.feature as cfeature from ..cbook import get_test_data @@ -13,7 +14,13 @@ class MetPyMapFeature(cfeature.NaturalEarthFeature): def __init__(self, name, scale, **kwargs): """Create USCountiesFeature instance.""" - super().__init__('', name, scale, **kwargs) + super(cfeature.NaturalEarthFeature, self).__init__(ccrs.PlateCarree(), **kwargs) + + self.category = '' + self.name = name + self.scaler = ( + cfeature.Scaler(scale) if not isinstance(scale, cfeature.Scaler) else scale + ) def geometries(self): """Return an iterator of (shapely) geometries for this feature."""