If masking a timeseries followed by clustering, the timeseries given to the clustering function may be an incorrect length, particularly if the mask includes the last timestep in the timeseries
For each mask, the information about the chosen timesteps in the mask is saved to the model xarray Dataset attributes. As it is saved as a pandas DataFrame, it cannot be serialised for saving to NetCDF. Either the information has to be removed, or has to be simplified to a string.
Since the introduction of datesteps (for inter-cluster storage), masking needs to be updated to include its own datesteps in the final datestep list.
This all needs updating, plus tests to cover these combinations added.
Problem description
If masking a timeseries followed by clustering, the timeseries given to the clustering function may be an incorrect length, particularly if the mask includes the last timestep in the timeseries
For each mask, the information about the chosen timesteps in the mask is saved to the model xarray Dataset attributes. As it is saved as a pandas DataFrame, it cannot be serialised for saving to NetCDF. Either the information has to be removed, or has to be simplified to a string.
Since the introduction of datesteps (for inter-cluster storage), masking needs to be updated to include its own datesteps in the final datestep list.
This all needs updating, plus tests to cover these combinations added.
Steps to reproduce the problem
Applying timeseries clustering e.g.:
Calliope version
0.6.3