ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

fix_metadata for cmip6 awi_esm_1_1_lr fails if "parent_time_units" isn't in attributes dict #2494

Closed brittaGrusdt closed 3 weeks ago

brittaGrusdt commented 1 month ago

The fix_metadata for CMIP6 awi_esm_1_1_lr fails when no parent file exists since in that case the key 'parent_time_units' is not present in the attributes dictionary. See original issue and the relevant source code

Please attach

valeriupredoi commented 1 month ago

hi @brittaGrusdt many thanks for opening this! I am going to transfer the issue to ESMValCore since it looks to be a bug in the preprocessing function, and will assign some folks to have a look at it. Cheers :beer:

brittaGrusdt commented 1 month ago

Thank you very much :) I added a pull request (see #2507) that solves the problem by simply accepting a KeyError (besides AttributeError).