From 9b827af8dae4aa43b67a477019799a016f5e14a5 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Thu, 23 Nov 2023 07:17:55 -0700 Subject: [PATCH] FIX: Remove force_path_ccw of contours This was added to fix previously unoriented paths from Matplotlib's contouring code. This has seemingly been fixed upstream somewhere in the past and there is no test/reproducer in Cartopy, so we can remove this for now. --- lib/cartopy/mpl/geoaxes.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index f83e31509..49540e430 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -171,12 +171,7 @@ def transform_path_non_affine(self, src_path): return mpath.Path(self.transform(src_path.vertices)) transformed_geoms = [] - # Check whether this transform has the "force_path_ccw" attribute set. - # This is a cartopy extension to the Transform API to allow finer - # control of Path orientation handling (Path ordering is not important - # in matplotlib, but is in Cartopy). - geoms = cpatch.path_to_geos(src_path, - getattr(self, 'force_path_ccw', False)) + geoms = cpatch.path_to_geos(src_path) for geom in geoms: proj_geom = self.target_projection.project_geometry( @@ -1642,12 +1637,6 @@ def contourf(self, *args, **kwargs): t = kwargs.get('transform') if isinstance(t, ccrs.Projection): kwargs['transform'] = t = t._as_mpl_transform(self) - # Set flag to indicate correcting orientation of paths if not ccw - if isinstance(t, mtransforms.Transform): - for sub_trans, _ in t._iter_break_from_left_to_right(): - if isinstance(sub_trans, InterProjectionTransform): - if not hasattr(sub_trans, 'force_path_ccw'): - sub_trans.force_path_ccw = True result = super().contourf(*args, **kwargs)