Skip to content

Commit

Permalink
remove no longer needed multipath-fix (now implemented in cartopy)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelquast committed Jun 23, 2024
1 parent cec6008 commit 8af8d1d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions eomaps/eomaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,6 @@ def _handle_backends():
"To change, use Maps.config(use_interactive_mode=True/False)."
)


def _fix_multipath_GeoSpine():
# temporary fix for the treatment of multi-path GeoSpines
from packaging import version

cartopy_version = version.parse(importlib.metadata.version("cartopy"))
if cartopy_version <= version.Version("0.23.0"):
from cartopy.mpl.geoaxes import GeoSpine

def _adjust_location(self):
if self.stale:
self._path = self._original_path.clip_to_bbox(self.axes.viewLim)
# only attempt to close paths that represent a single polygon
if np.count_nonzero(self._path.codes == mpath.Path.MOVETO) <= 1:
self._path = mpath.Path(self._path.vertices, closed=True)

GeoSpine._adjust_location = _adjust_location


# hardcoded list of available mapclassify-classifiers
# (to avoid importing it on startup)
_CLASSIFIERS = (
Expand Down Expand Up @@ -5357,10 +5338,6 @@ def _set_gdf_path_boundary(self, gdf, set_extent=True):

self.set_extent([x0, x1, y0, y1], gdf.crs)

if multi:
# TODO apply fix for multi-path geometries (see cartopy PR #2362)
_fix_multipath_GeoSpine()

def set_frame(self, rounded=0, gdf=None, set_extent=True, **kwargs):
"""
Set the properties of the map boundary and the background patch.
Expand Down

0 comments on commit 8af8d1d

Please sign in to comment.