Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi_model_statistics fail when only a single dataset is given #1469

Closed
schlunma opened this issue Feb 4, 2022 · 1 comment
Closed

multi_model_statistics fail when only a single dataset is given #1469

schlunma opened this issue Feb 4, 2022 · 1 comment
Assignees
Labels
preprocessor Related to the preprocessor

Comments

@schlunma
Copy link
Contributor

schlunma commented Feb 4, 2022

(Apologies for posting this again in case this was already discussed, but I didn't find an issue about this.)

While testing #673 I realized that multi_model_statistics fails when only a single input dataset is given:

if len(cubes) == 1:
raise ValueError('Cannot perform multicube statistics '
'for a single cube.')

Especially with the introduction of groupy and ensemble_statistics, I don't think this is good behavior. For most statistics we support there are reasonable default values (i.e. the formulas used to calculate these values work perfectly fine for just one value), e.g. simply return the input data for mean, gmean, hmean, min, max, sum, rms; or return 0 for std, var. I'm not entirely sure about others like percentiles.

Would it make sense to just "hardcode" these defaults for these special cases? Unfortunately iris also raises an error in this case:
iris.exceptions.CoordinateCollapseError: Cannot collapse a dimension which does not describe any data. @ESMValGroup/esmvaltool-coreteam

Note: It is possible to avoid this by using the exclude key, but since this only takes dataset names into account it might fail for more complex ensembles and groupby settings.

@schlunma schlunma added the preprocessor Related to the preprocessor label Feb 4, 2022
@schlunma schlunma self-assigned this Feb 4, 2022
@schlunma
Copy link
Contributor Author

Duplicate of #1211

@schlunma schlunma marked this as a duplicate of #1211 Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preprocessor Related to the preprocessor
Projects
None yet
Development

No branches or pull requests

1 participant