diff --git a/climax/core/dataset.py b/climax/core/dataset.py index c18df0268bfde1867d26ee0499e222d80c20cf9f..fce18fec5362f237131c0c8f1faffabbed80ced7 100644 --- a/climax/core/dataset.py +++ b/climax/core/dataset.py @@ -122,8 +122,17 @@ class EoDataset(torch.utils.data.Dataset): Spredictors = ''.join([ERA5_S_VARIABLE_NAME[p] for p in predictors if p in ERA5_S_VARIABLE_NAME]) plevels = [str(p) for p in plevels] - state_file = '_'.join([model.__name__, str(predictand), Ppredictors, - *plevels, Spredictors]) + state_file = '_'.join([model.__name__, str(predictand)]) + + # check if predictors on pressure levels are used + state_file = ('_'.join([state_file, Ppredictors, *plevels]) if + any([p in ERA5_P_VARIABLE_NAME for p in predictors]) else + state_file) + + # check if predictors on surface are used + state_file = ('_'.join([state_file, Spredictors]) if + any([p in ERA5_S_VARIABLE_NAME for p in predictors]) else + state_file) # check whether digital elevation model, slope and aspect, and the day # of year were used