From 9af9ba5492117c663256f04c13526946dfb9bad0 Mon Sep 17 00:00:00 2001 From: James Frost Date: Tue, 29 Oct 2024 09:56:32 +0000 Subject: [PATCH 1/2] Add dummy renderer argument to _draw_preprocess Commit 454567a2c8876f90969617be6fe4fd053f5e5e21 changes the method signature of GeoAxes._preprocess_draw. This causes TypeErrors in user code that expects draw to take a renderer argument, notably iris code with bbox_inches="tight". This commit reinstates the argument in the _draw_preprocess function to make the method signature compatible. The value of the argument is never used in the function. --- lib/cartopy/mpl/geoaxes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cartopy/mpl/geoaxes.py b/lib/cartopy/mpl/geoaxes.py index 85028ad2d..b09cfc9bb 100644 --- a/lib/cartopy/mpl/geoaxes.py +++ b/lib/cartopy/mpl/geoaxes.py @@ -451,10 +451,12 @@ def hold_limits(self, hold=True): self.get_autoscaley_on()) yield - def _draw_preprocess(self): + def _draw_preprocess(self, renderer=None): """ Perform pre-processing steps shared between :func:`GeoAxes.draw` and :func:`GeoAxes.get_tightbbox`. + + Renderer argument does nothing, but is retained for API compatibility. """ # If data has been added (i.e. autoscale hasn't been turned off) # then we should autoscale the view. From 2a988ff954eee8f044ce88939e3809e29c65bcf3 Mon Sep 17 00:00:00 2001 From: James Frost Date: Tue, 29 Oct 2024 10:19:49 +0000 Subject: [PATCH 2/2] Add James Frost to list of contributors --- docs/source/contributors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/contributors.rst b/docs/source/contributors.rst index 769c0731f..bf5e0c943 100644 --- a/docs/source/contributors.rst +++ b/docs/source/contributors.rst @@ -43,6 +43,7 @@ the package wouldn't be as rich or diverse as it is today: * Stephane Raynaud * John Krasting * Matthias Cuntz + * James Frost Thank you!