From 82a8d5827eb8aadaad553369dc672db9afa51d5d Mon Sep 17 00:00:00 2001 From: DirkEilander Date: Wed, 18 Dec 2024 14:13:10 +0100 Subject: [PATCH 1/3] unpin_numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 707e6888..6ddd73bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ "geopandas>1.0", "hydromt>=0.10, <0.11", "numba", - "numpy<2.0", # temp pin until bottleneck release v1.4 + "numpy", "pandas", "pillow", "pyflwdir>=0.5.5", From 0889e2decc787514288883245a50a058f9c14f86 Mon Sep 17 00:00:00 2001 From: DirkEilander Date: Wed, 18 Dec 2024 14:22:32 +0100 Subject: [PATCH 2/3] fix errors scipy and numpy --- hydromt_sfincs/regulargrid.py | 4 ++-- hydromt_sfincs/workflows/curvenumber.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hydromt_sfincs/regulargrid.py b/hydromt_sfincs/regulargrid.py index 3d8dca13..a28d75ee 100644 --- a/hydromt_sfincs/regulargrid.py +++ b/hydromt_sfincs/regulargrid.py @@ -228,7 +228,7 @@ def create_mask_active( _msk1 = np.logical_xor( da_mask, ndimage.binary_fill_holes(da_mask, structure=s) ) - regions = ndimage.measurements.label(_msk1, structure=s)[0] + regions = ndimage.label(_msk1, structure=s)[0] # TODO check if region_area works for rotated grids! lbls, areas = region_area(regions, self.transform, latlon) n = int(sum(areas / 1e6 < fill_area)) @@ -237,7 +237,7 @@ def create_mask_active( da_mask, np.isin(regions, lbls[areas / 1e6 < fill_area]) ) if drop_area > 0: - regions = ndimage.measurements.label(da_mask.values, structure=s)[0] + regions = ndimage.label(da_mask.values, structure=s)[0] lbls, areas = region_area(regions, self.transform, latlon) _msk = np.isin(regions, lbls[areas / 1e6 >= drop_area]) n = int(sum(areas / 1e6 < drop_area)) diff --git a/hydromt_sfincs/workflows/curvenumber.py b/hydromt_sfincs/workflows/curvenumber.py index 75c31d49..919ba145 100644 --- a/hydromt_sfincs/workflows/curvenumber.py +++ b/hydromt_sfincs/workflows/curvenumber.py @@ -43,7 +43,7 @@ def scs_recovery_determination( ).load() # Curve numbers to grid: go over NLCD classes and HSG classes - da_CN = xr.full_like(da_landuse, np.NaN, dtype=np.float32) + da_CN = xr.full_like(da_landuse, np.nan, dtype=np.float32) for i in range(df_map.index.size): for j in range(df_map.columns.size): ind = (da_landuse == df_map.index[i]) & ( From 006d29eaa9011f4108b4ecb4a6034699cda4886c Mon Sep 17 00:00:00 2001 From: DirkEilander Date: Thu, 19 Dec 2024 10:47:39 +0100 Subject: [PATCH 3/3] update pyflwdir --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ddd73bc..5ea4249a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "numpy", "pandas", "pillow", - "pyflwdir>=0.5.5", + "pyflwdir>=0.5.9", "pyproj", "rasterio", "scipy",