E3SM-Project / e3sm_diags

E3SM Diagnostics package
https://e3sm-project.github.io/e3sm_diags
BSD 3-Clause "New" or "Revised" License
42 stars 32 forks source link

CDAT Migration TODO: Update logic in `get_ref_climo_dataset` when ref data not available #823

Closed chengzhuzhang closed 4 weeks ago

chengzhuzhang commented 4 months ago

There is one TODO item in most sets that is we'd like to change the logic when ref data is not available when getting the reference climatology dataset for the variable and season.

The current logic: If the reference climatatology does not exist or could not be found, it will be considered a model-only run. For this case the test dataset is returned as a default value and subsequent metrics calculations will only be performed on the original test dataset.

When refactor, it has been troublesome, e.g. it would be useful to provide explicit error info for trouble shooting, also it can be easily to use test data as ref by mistake based on my recent experience refactoring.

Reference TODO item logged by @tomvothecoder

        # TODO: This logic was carried over from legacy implementation. It
        # can probably be improved on by setting `ds_ref = None` and not
        # performing unnecessary operations on `ds_ref` for model-only runs,
        # since it is the same as `ds_test`. In addition, returning ds_test
        # makes it difficult for debugging.

I think we perhaps should prioritize this item before more sets are being converted.

tomvothecoder commented 4 weeks ago

Closed by #846