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
218 stars 128 forks source link

Including same preprocessor twice doesn't cause an error #3240

Open ledm opened 1 year ago

ledm commented 1 year ago

I've found that including the same preprocessor twice is not causing an error in ESMValTool 2.9.0. My preprocessor was:

preprocessors:
  # --------------------------------------------------
  # Time series preprocessors
  # --------------------------------------------------
  prep_regional_ts_3d_surface: # For regional fields
    custom_order: true
    extract_region: &mpa_region {end_latitude: -50., end_longitude: -10, start_latitude: -20.,
      start_longitude: 20.}

    area_statistics:
      operator: mean

    area_statistics:
      operator: mean

    extract_levels:
       scheme: nearest_extrapolate
       levels: [0.5, ]

@valeriupredoi said that this should flag a DuplicatePreprocessurNameError, but it does not. It attempts to run the preprocessor chain and fails silently.

ledm commented 1 year ago

Having said that, I can envisage certain situations where you would want to run the same thing qpre processor more than once. For instance, you might want to extract a largish region, perform a regrid, then extract a smaller second region.

bouweandela commented 1 year ago

It attempts to run the preprocessor chain and fails silently.

Could you explain in more detail what you mean by 'fails silently'? Considering the YAML file format, it seems more likely that the second definition will overwrite the first one and then things will run as usual.