Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map plots with latest iris=3.10.0 and cartopy=0.24.0 fail #3767

Closed
schlunma opened this issue Oct 10, 2024 · 2 comments · Fixed by #3768
Closed

Map plots with latest iris=3.10.0 and cartopy=0.24.0 fail #3767

schlunma opened this issue Oct 10, 2024 · 2 comments · Fixed by #3768
Labels
Milestone

Comments

@schlunma
Copy link
Contributor

Describe the bug
Running recipes that use iris to plot map plots (e.g., recipe_python.yml) currently fail with iris=3.10.0 and cartopy=0.24.0. This affects the current development version of ESMValTool, but also the released ESMValTool v2.11.0 on conda-forge (and possibly earlier versions, too).

Corresponding iris issue and PR:

Here is the traceback:

Traceback (most recent call last):
194   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/esmvaltool/diag_scripts/examples/diagnostic.py", line 111, in <module>
195     main(config)
196   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/esmvaltool/diag_scripts/examples/diagnostic.py", line 105, in main
197     plot_diagnostic(cube, output_basename, provenance_record, cfg)
198   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/esmvaltool/diag_scripts/examples/diagnostic.py", line 65, in plot_diagnostic
199     save_figure(basename, provenance_record, cfg)
200   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/esmvaltool/diag_scripts/shared/_base.py", line 101, in save_figure
201     fig.savefig(filename, **kwargs)
202   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/pyplot.py", line 1134, in savefig
203     res = fig.savefig(*args, **kwargs)  # type: ignore[func-returns-value]
204           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/figure.py", line 3390, in savefig
206     self.canvas.print_figure(fname, **kwargs)
207   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 2193, in print_figure
208     result = print_method(
209              ^^^^^^^^^^^^^
210   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 2043, in <lambda>
211     print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
212                                                                  ^^^^^
213   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py", line 497, in print_png
214     self._print_pil(filename_or_obj, "png", pil_kwargs, metadata)
215   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py", line 445, in _print_pil
216     FigureCanvasAgg.draw(self)
217   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw
218     self.figure.draw(self.renderer)
219   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/artist.py", line 95, in draw_wrapper
220     result = draw(artist, renderer, *args, **kwargs)
221              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
223     return draw(artist, renderer)
224            ^^^^^^^^^^^^^^^^^^^^^^
225   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/figure.py", line 3154, in draw
226     mimage._draw_list_compositing_images(
227   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
228     a.draw(renderer)
229   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
230     return draw(artist, renderer)
231            ^^^^^^^^^^^^^^^^^^^^^^
232   File "/home/manuel/micromamba/envs/test/lib/python3.12/site-packages/cartopy/mpl/geoaxes.py", line 509, in draw
233     self._draw_preprocess()
234 TypeError: _GeoAxesPatched._draw_preprocess() missing 1 required positional argument: 'renderer'
@schlunma schlunma added the bug label Oct 10, 2024
@schlunma schlunma added this to the v2.12.0 milestone Oct 10, 2024
@valeriupredoi
Copy link
Contributor

we may want to open a followup issue "Unpin Cartopy" like we did for curl, after we merge #3768 - cartopy is one of those big deps that it's good to have as up to date as possible

@schlunma
Copy link
Contributor Author

See #3769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants