You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recipe recipe_flato13ipcc.yml crashes due to a new IRIS version:
2021-10-28 11:31:58,651 [5412] INFO esmvaltool.diag_scripts.shared._base,550 Creating /work/bd1083/b380216/output/recipe_flato13ipcc_20211028_100738/plots/fig09-14/fig09-14
Traceback (most recent call last):
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 407, in
main(cfg)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 396, in main
plot_path = produce_plots(config, data)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 351, in produce_plots
lines, labels = plot_zonal_mean_errors_ensemble(
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 259, in plot_zonal_mean_errors_ensemble
cube_list = multi_model_merge(zonal_mean_errors)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 177, in multi_model_merge
equalise_attributes(cube_list)
File "/work/bd0854/b380216/anaconda3/envs/esmvaltool202106/lib/python3.9/site-packages/iris/experimental/equalise_cubes.py", line 30, in equalise_attributes
raise Exception(emsg)
Exception: The function "iris.experimental.equalise_cubes.equalise_attributes" has been moved.
Please replace "iris.experimental.equalise_cubes.equalise_attributes()" with "iris.util.equalise_attributes()".
It should be easy to fix with changing:
from iris.experimental.equalise_cubes import equalise_attributes
to
from iris.util import equalise_attributes
This new line is already used in ESMValCore/esmvalcore/preprocessor/_multimodel.py
I make this a draft first because I want to check if it runs (it did not the first time but that could have been caused by other issues.)
Closes #issue_number
Link to documentation:
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
Sorry, that I'm to slow with the tests, but recipe_flato13ipcc.yml still doesn't run. That is probably not caused by that line but related: In addition to equalise_attributes the diagnostic removes several possible the auxiliary coordinates for time to allow for the multi model mean with:
equalise_attributes(cube_list)
for cube in cube_list:
cube.cell_methods = tuple()
for coord in ['day_of_month', 'month_number', 'year']:
try:
cube.remove_coord(coord)
except CoordinateNotFoundError:
pass
Now it looks as there is a new one in one of the data sets, which is not included, yet. I get the error:
iris.exceptions.MergeError: failed to merge into a single cube.
Coordinates in cube.aux_coords (scalar) differ: time.
(I also had to remove several data sets from the recipe to come to that point because I didn't want to check the new download tool.)
I try to find the aux_coord name or data set which causes that and will open a new PR if removing an additional aux_coord helps.
The best is probably to use (or mimic) the complete function used for a similar purpose in the preprocessor (esmvalcore/preprocessor/_multimodel.py)?
def _combine(cubes):
"""Merge iris cubes into a single big cube with new dimension.
This assumes that all input cubes have the same shape.
"""
equalise_attributes(cubes) # in-place
for i, cube in enumerate(cubes):
concat_dim = iris.coords.AuxCoord(i, var_name=CONCAT_DIM)
cube.add_aux_coord(concat_dim)
# Clear some metadata that can cause merge to fail
# https://scitools-iris.readthedocs.io/en/stable/userguide/
# merge_and_concat.html#common-issues-with-merge-and-concatenate
remove_fx_variables(cube)
cube.cell_methods = None
for coord in cube.coords():
coord.long_name = None
coord.attributes = None
cubes = iris.cube.CubeList(cubes)
merged_cube = cubes.merge_cube()
return merged_cube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Recipe recipe_flato13ipcc.yml crashes due to a new IRIS version:
2021-10-28 11:31:58,651 [5412] INFO esmvaltool.diag_scripts.shared._base,550 Creating /work/bd1083/b380216/output/recipe_flato13ipcc_20211028_100738/plots/fig09-14/fig09-14
Traceback (most recent call last):
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 407, in
main(cfg)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 396, in main
plot_path = produce_plots(config, data)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 351, in produce_plots
lines, labels = plot_zonal_mean_errors_ensemble(
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 259, in plot_zonal_mean_errors_ensemble
cube_list = multi_model_merge(zonal_mean_errors)
File "/mnt/lustre02/work/bd1083/b380216/CORE202102/ESMValTool/esmvaltool/diag_scripts/ipcc_ar5/ch09_fig09_14.py", line 177, in multi_model_merge
equalise_attributes(cube_list)
File "/work/bd0854/b380216/anaconda3/envs/esmvaltool202106/lib/python3.9/site-packages/iris/experimental/equalise_cubes.py", line 30, in equalise_attributes
raise Exception(emsg)
Exception: The function "iris.experimental.equalise_cubes.equalise_attributes" has been moved.
Please replace "iris.experimental.equalise_cubes.equalise_attributes()" with "iris.util.equalise_attributes()".
It should be easy to fix with changing:
from iris.experimental.equalise_cubes import equalise_attributes
to
from iris.util import equalise_attributes
This new line is already used in ESMValCore/esmvalcore/preprocessor/_multimodel.py
I make this a draft first because I want to check if it runs (it did not the first time but that could have been caused by other issues.)
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
New or updated recipe/diagnostic
To help with the number of pull requests: