Closed sloosvel closed 1 year ago
So far, I am able to solve the issues in the timeseries plots. But for the maps I get a very strange error during the saving. I am still looking into it, but I add the log in here in case anyone may have an idea of what may be happening:
Traceback (most recent call last):
File "/home/b/b381943/ESMValTool/esmvaltool/diag_scripts/monitor/monitor.py", line 577, in <module>
main()
File "/home/b/b381943/ESMValTool/esmvaltool/diag_scripts/monitor/monitor.py", line 573, in main
Monitor(config).compute()
File "/home/b/b381943/ESMValTool/esmvaltool/diag_scripts/monitor/monitor.py", line 169, in compute
self.plot_monthly_climatology(cube, var_info)
File "/home/b/b381943/ESMValTool/esmvaltool/diag_scripts/monitor/monitor.py", line 342, in plot_monthly_climatology
plt.savefig(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/pyplot.py", line 1023, in savefig
res = fig.savefig(*args, **kwargs)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/figure.py", line 3343, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 2366, in print_figure
result = print_method(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 2232, in <lambda>
print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 509, in print_png
self._print_pil(filename_or_obj, "png", pil_kwargs, metadata)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 457, in _print_pil
FigureCanvasAgg.draw(self)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 400, in draw
self.figure.draw(self.renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 95, in draw_wrapper
result = draw(artist, renderer, *args, **kwargs)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/figure.py", line 3140, in draw
mimage._draw_list_compositing_images(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/cartopy/mpl/geoaxes.py", line 538, in draw
return super().draw(renderer=renderer, **kwargs)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 3064, in draw
mimage._draw_list_compositing_images(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/cartopy/mpl/geoaxes.py", line 262, in draw
super().draw(renderer, *args, **kwargs)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/patches.py", line 591, in draw
self._draw_paths_with_artist_properties(
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/patches.py", line 576, in _draw_paths_with_artist_properties
renderer.draw_path(gc, *draw_path_args)
File "/work/bk1088/b381943/mambaforge/envs/coretool28rc1/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 146, in draw_path
self._renderer.draw_path(gc, path, transform, rgbFace)
TypeError: must be real number, not str
All clear now, it's an issue when setting the linewidth in mapgenerator. I will work with @fbeninca to fix it.
@sloosvel you guys managed to make some headway on this? Do you need any help?
Yes, mapgenerator has been updated in PyPi to include the changes that were needed https://pypi.org/project/mapgenerator/ . I guess it should be updated in conda forge now but I don't know who was doing that in the end.
mapgenerator on conda is updated indeed but there is a mismatch between the PyPI and conda forge versions https://anaconda.org/conda-forge/mapgenerator and https://pypi.org/project/mapgenerator/
It's not a mismatch, it's just that the newest version is not on condaforge.
Ok the newest version is there now, @remi-kazeroni I guess that when creating new environments, the recipe should run now
Thanks for following up on this @sloosvel! I'll check during the next round of testing (today or tomorrow) that it works and we could then close this issue
I got a successful run in https://esmvaltool.dkrz.de/shared/esmvaltool/v2.8.0rc2/recipe_monitor_20230321_133858/ My freshly created env has mapgenerator=1.0.7
. Could you please check the output @sloosvel and close this issue if all fine?
The only differences in the plots that I have seen are some new ticks in the colorbars for the maps and a small change of size in the timeseries plots. It all looks fine to me, so I am closing this.
brilliant, many thanks @sloosvel :beer:
Describe the bug As recported in #3076, the monitor diagnostics are failing due to issues with mapgenerator and matplotlib. @remi-kazeroni to fix this I will need to fix map generator so, I don't think I will open a PR in here. I will let you now when the issues and the new version with the fixes has been published.