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
217 stars 126 forks source link

Recipe carvalhais is failing due to incompatibility of cartopy with scipy>=1.11.0 #3281

Closed valeriupredoi closed 1 year ago

valeriupredoi commented 1 year ago
Traceback (most recent call last):
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 819, in <module>
    main(config)
  File "/home/b/b382109/ESMValTool/esmvaltool/diag_scripts/land_carbon_cycle/diag_global_turnover.py", line 757, 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 654, in _plot_single_map
    plt.imshow(_get_data_to_plot(_dat.data),
  File "/home/b/b382109/miniconda3/envs/tool-latest/lib/python3.11/site-packages/matplotlib/pyplot.py", line 2695, in imshow
    __ret = gca().imshow(
            ^^^^^^^^^^^^^
  File "/home/b/b382109/miniconda3/envs/tool-latest/lib/python3.11/site-packages/cartopy/mpl/geoaxes.py", line 318, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b/b382109/miniconda3/envs/tool-latest/lib/python3.11/site-packages/cartopy/mpl/geoaxes.py", line 1331, in imshow
    img, extent = warp_array(img,
                  ^^^^^^^^^^^^^^^
  File "/home/b/b382109/miniconda3/envs/tool-latest/lib/python3.11/site-packages/cartopy/img_transform.py", line 192, in warp_array
    array = regrid(array, source_native_xy[0], source_native_xy[1],
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b/b382109/miniconda3/envs/tool-latest/lib/python3.11/site-packages/cartopy/img_transform.py", line 278, in regrid
    _, indices = kdtree.query(target_xyz, k=1)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_ckdtree.pyx", line 795, in scipy.spatial._ckdtree.cKDTree.query
ValueError: 'x' must be finite, check for nan or inf values

this is signaled and raised here https://github.com/SciTools/cartopy/issues/2199 and it looks like they already have a PR to fix it - keep an eye when https://github.com/SciTools/cartopy/pull/2201 gets merged :portugal:

valeriupredoi commented 1 year ago

@remi-kazeroni https://github.com/SciTools/cartopy/pull/2201 got merged in the meantime so we may want to retest carvalhais with a brand new environment, when cartopy release a new version - not sure when that'd be since their last release was December last year :grimacing:

valeriupredoi commented 1 year ago

to check here - https://anaconda.org/conda-forge/cartopy - still at nearly 5 months old :older_man:

rbeucher commented 1 year ago

Looks like It has been updated.

remi-kazeroni commented 1 year ago

Thanks for spotting that release! Indeed, I could get a successful run with that recipe after updating to cartopy=0.22.0 in my environment. I'll make a PR to remove that recipe from the list of broken ones and close this issue 👍

valeriupredoi commented 1 year ago

woohoo cheers gents, this fell of me radar :dart: