[X] I have checked that this issue has not already been reported.
[X] I have checked that this bug exists on the latest version of HydroMT.
Reproducible Example
Using deltares data catalog:
datacatalog.get_source_time_range("gcn250")
Current behaviour
Will result in a key error because ds.raster.time_dim is None in ds[ds.raster.time_dim].min().values
Desired behaviour
If the source does not have a time dimension it should give back a warning.
I suggest to raise a TypeError when ds.raster.time_dim is None in detect_time_range() in the rasterdataset adapter.
indeed definitely good to have a better error. This might also be a nice place for the new NoDataStrategy pattern so we give users flexibility in this.
HydroMT version checks
Reproducible Example
Using deltares data catalog:
datacatalog.get_source_time_range("gcn250")
Current behaviour
Will result in a key error because
ds.raster.time_dim
is None inds[ds.raster.time_dim].min().values
Desired behaviour
If the source does not have a time dimension it should give back a warning. I suggest to raise a TypeError when
ds.raster.time_dim
is None indetect_time_range()
in the rasterdataset adapter.Additional context
No response