[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-Wflow.
Reproducible Example
Happens if these conditions are met:
building a model with kind basin
basin variable not available in hydrography_fn or available with wrong dtype
no upscaling required (model resolution is the same as hydrography_fn)
Current behaviour
The output wflow_subcatch dtype can be np.uint32 instead of np.int32. Not a problem to run wflow but for example vectorizing the map does not work anymore (which is used in the read_results method):
model.grid["wflow_subcatch"].raster.vectorize()
> ValueError: image dtype must be one of: int16, int32, uint8, uint16, float32
In case of basin variable not available in hydrography_fn, the uint32 actually pops up in the hydromt.workflows.get_basin_geometry:
HydroMT-Wflow version checks
Reproducible Example
Happens if these conditions are met:
Current behaviour
The output wflow_subcatch dtype can be np.uint32 instead of np.int32. Not a problem to run wflow but for example vectorizing the map does not work anymore (which is used in the
read_results
method):In case of basin variable not available in hydrography_fn, the uint32 actually pops up in the
hydromt.workflows.get_basin_geometry
:https://github.com/Deltares/hydromt/blob/d634534fd1c3c5e470d6835a1ee1c518705576ad/hydromt/workflows/basin_mask.py#L380
Desired behaviour
Make sure that basin dtype is np.int32 in that part of the
hyrography
workflow:https://github.com/Deltares/hydromt_wflow/blob/c2074330ea28fae65bd4f184e4c9bf8405cbf117/hydromt_wflow/workflows/basemaps.py#L204-L216
Additional context
No response