ESMValGroup / ESMValTool

ESMValTool: A community diagnostic and performance metrics tool for routine evaluation of Earth system models in CMIP
https://www.esmvaltool.org
Apache License 2.0
211 stars 124 forks source link

Recipe recipe_carvalhais14nat.yml fails at plotting in diagnostic #2886

Closed valeriupredoi closed 1 year ago

valeriupredoi commented 1 year ago

Diagnostic trace:

2022-10-25 14:19:19,739 [1835463] INFO     esmvaltool.diag_scripts.shared._base,550     Creating /scratch/b/b382109/esmvaltool_output/recipe_carvalhais14nat_20221025_141607/work/diag_land_carbon_turnover/global_turnover_time
2022-10-25 14:19:19,741 [1835463] INFO     esmvaltool.diag_scripts.shared._base,550     Creating /scratch/b/b382109/esmvaltool_output/recipe_carvalhais14nat_20221025_141607/plots/diag_land_carbon_turnover/global_turnover_time
2022-10-25 14:19:19,898 [1835463] WARNING  py.warnings,109      /home/b/b382109/miniconda3/envs/tool270Test/lib/python3.10/site-packages/iris/cube.py:3696: UserWarning: Collapsing spatial coordinate 'latitude' without weighting
  warnings.warn(msg.format(coord.name()))

2022-10-25 14:19:19,904 [1835463] WARNING  py.warnings,109      /home/b/b382109/miniconda3/envs/tool270Test/lib/python3.10/site-packages/iris/cube.py:3696: UserWarning: Collapsing spatial coordinate 'latitude' without weighting
  warnings.warn(msg.format(coord.name()))

Traceback (most recent call last):
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 817, in <module>
    main(config)
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 755, in main
    _plot_single_map(plot_path_mod, tau_ctotal,
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 660, in _plot_single_map
    _fix_map(_ax)
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 278, in _fix_map
    plt.gca().outline_patch.set_visible(False)
AttributeError: 'GeoAxes' object has no attribute 'outline_patch'

Matplotlib:

(tool270Test) conda list matplotlib
# packages in environment at /home/b/b382109/miniconda3/envs/tool270Test:
#
# Name                    Version                   Build  Channel
matplotlib-base           3.5.3           py310h8d5ebf3_2    conda-forge
valeriupredoi commented 1 year ago

@zklaus do you remember Sujan's GH handle? I was sure it was @koirsu

zklaus commented 1 year ago

I think he may have changed his handle and that it is now @dr-ko. @dr-ko, Sujan, is that you?

Besides, GeoAxes comes from cartopy, so @valeriupredoi, could you add version information for cartopy to the description?

valeriupredoi commented 1 year ago

cheers muchly @zklaus - here's me cartopy:

(tool270Test) conda list cartopy
# packages in environment at /home/b/b382109/miniconda3/envs/tool270Test:
#
# Name                    Version                   Build  Channel
cartopy                   0.21.0          py310hcda3f9e_0    conda-forge
zklaus commented 1 year ago

Seems the diagnostic relies on a feature that was deprecated in cartopy 0.18 and finally removed in cartopy 0.21.

valeriupredoi commented 1 year ago

@zklaus you an absolute debugging legend - cheers, had no time to look at it! I am not able to fix this/even to look at it given I am under a fair amount of pressure from all those test runs, what would you recommend be the best way to go about it?

zklaus commented 1 year ago

The fix seems straight-forward: Replace .outline_patch with .spines["geo"]. If we get that in, is it easy to test and compare with the earlier version?

valeriupredoi commented 1 year ago

worked like charm, @zklaus - :beer: your way! Do you want to PR it or should I?

zklaus commented 1 year ago

@valeriupredoi, go ahead :stuck_out_tongue_closed_eyes:

valeriupredoi commented 1 year ago

will do now, thanks, bud :beer:

valeriupredoi commented 1 year ago

Good news! We can PR the heck out of that, results are identical, only that plots are pdf now

valeriupredoi commented 1 year ago

this was fixed, beats me which PR I fixed it in though

zklaus commented 1 year ago

Hm. Which cartopy do you have in the environment where you tested? It looks like the code is unchanged and since it only breaks with the very latest cartopy, is it possible that now an earlier version was used for testing?

dr-ko commented 1 year ago

Thanks guys... I hope the bug is fixed by now. And, yes, the handle changed. I wanted to sound cool in github, lol 😶‍🌫️

zklaus commented 1 year ago

Welcome back, @dr-ko :beers: