Skip to content

Commit

Permalink
FIX: explicitly list functions not allowed for spherical transforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
greglucas committed Dec 19, 2020
1 parent 9f88664 commit c851bfa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down

0 comments on commit c851bfa

Please sign in to comment.