From c851bfac5655ddb8dd82fbdc7be6ac2b499a7851 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Fri, 12 Jun 2020 07:32:12 -0600 Subject: [PATCH] FIX: explicitly list functions not allowed for spherical transforms. --- lib/cartopy/mpl/geoaxes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index 113ebe5f4..4f13b4f5c 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -306,7 +306,12 @@ def wrapper(self, *args, **kwargs): transform = kwargs.get('transform', None) if transform is None: transform = self.projection - if (isinstance(transform, ccrs.CRS) and + # Raise an error if any of these functions try to use + # a spherical source CRS. + non_spherical_funcs = ['contour', 'contourf', 'pcolormesh', 'pcolor', + 'quiver', 'barbs', 'streamplot'] + if (func.__name__ in non_spherical_funcs and + isinstance(transform, ccrs.CRS) and not isinstance(transform, ccrs.Projection)): raise ValueError('Invalid transform: Spherical {} ' 'is not supported - consider using '