From a9c4283a554e39b0c94ced59eb4080533ed3f71c Mon Sep 17 00:00:00 2001 From: hboisgon Date: Fri, 18 Oct 2024 14:09:30 +0800 Subject: [PATCH] update changelog --- docs/changelog.rst | 10 ++++-- hydromt_wflow/wflow.py | 4 +-- hydromt_wflow/workflows/demand.py | 54 ------------------------------- 3 files changed, 9 insertions(+), 59 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 872bae71..6ce06c0c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,11 +11,16 @@ Unreleased Added ----- -- +- **setup_lulcmaps_with_paddy**: method to add paddy to the model. Adding paddies leads to changes in landuse and soil parameters. PR #226 +- **setup_domestic_demand** and **setup_other_demand**: methods to prepare water demands for different sectors using gridded datasets. PR #226 +- **setup_irrigation**: method to prepare irrigation areas and parameters. PR #226 +- **setup_allocation_areas**: method to prepare allocation areas for water allocation. PR #226 +- **setup_allocation_surfacewaterfrac**: method to prepare surface water fraction for water allocation. PR #226 Changed ------- -- +- **setup_lulcmaps** prepares new vegetation parameters (crop coefficient kc and h values). PR #226 +- **set_grid** supports several cyclic time diemsions. PR #226 Fixed ----- @@ -60,7 +65,6 @@ Added - **setup_lulcmaps** for wflow_sediment: if planted forest data is available, it can be used to update the values of the USLE C parameter. PR #234 - New function **setup_cold_states** to prepare cold states for WflowModel. PR #252 - New utils method **get_grid_from_config** to get the right wflow staticmaps variable based on the TOML configuration (e.g. detects name in netcdf, value, scale and offset). Only applied now to prepare cold states (e.g. not yet in read_grid). PR #252 -- New functions (properly) for setting up water demand: **setup_allocation_areas**, **setup_surfacewaterfrac**, **setup_non_irrigation** and **setup_irrigation**. `PR #226 ` - Added support for the "GLCNMO" land-use dataset, with a default parameter mapping table (similar to the existing tables). PR #272 - Added the `alpha_h1` parameter (based on land use maps). This parameter represents whether root water uptake reduction at soil water pressure head h1 occurs or not. By default, it is set to 0.0 for all "non-natural" vegetation (crops) and to 1.0 for all "natural vegetation" PR #272 - Parameter for output filename in **write_grid** (`fn_out`). PR #278 diff --git a/hydromt_wflow/wflow.py b/hydromt_wflow/wflow.py index d5deeefc..9feb53d2 100644 --- a/hydromt_wflow/wflow.py +++ b/hydromt_wflow/wflow.py @@ -3361,7 +3361,7 @@ def setup_allocation_areas( align the water regions with the actual areas managed by water management authorities, such as regional water boards. - The allocation area will be an intersection the the wflow model basins and the + The allocation area will be an intersection of the wflow model basins and the water areas. For areas that do not contain river cells after intersection with the water areas, the priority_basins flag can be used to decide if these basins should be merged with the closest downstream basin or with any large enough @@ -3370,7 +3370,7 @@ def setup_allocation_areas( Parameters ---------- waterareas_fn : Union[str, gpd.GeoDataFrame] - Administrative boundaries in geopandas GeoDataFrame format, this could be + Administrative boundaries GeoDataFrame data, this could be e.g. water management areas by water boards or the administrative boundaries of countries. priority_basins : bool, optional diff --git a/hydromt_wflow/workflows/demand.py b/hydromt_wflow/workflows/demand.py index 3f03938d..e0702904 100644 --- a/hydromt_wflow/workflows/demand.py +++ b/hydromt_wflow/workflows/demand.py @@ -3,7 +3,6 @@ import logging from typing import List, Optional, Tuple -import dask import geopandas as gpd import numpy as np import xarray as xr @@ -27,59 +26,6 @@ } -def full( - da_like: xr.DataArray, - dtype: type = np.float32, - fill_value: float | int = np.nan, - crs: int = 4326, - name: str = "data", - extra: dict = None, -): - """_summary_.""" - # Setup some basic information from da_like - dims = da_like.dims - coords = {dim: da_like[dim].values for dim in dims} - size = [da_like.coords.sizes[dim] for dim in dims] - - # if not extra dimension is given, default to da_like - if extra is None: - dsk = dask.array.full( - shape=size, - dtype=dtype, - fill_value=fill_value, - ) - da = xr.DataArray( - data=dsk, - coords=da_like.coords, - dims=da_like.dims, - ) - da.attrs = {"_FillValue": fill_value} - da.name = name - return da - - # If extra dimensions are given, construct from there - coords.update(extra) - extra_size = [len(item) for item in extra.values()] - - dsk = dask.array.full( - shape=extra_size + size, - dtype=dtype, - fill_value=fill_value, - ) - da = xr.DataArray( - data=dsk, - coords=coords, - dims=tuple(extra.keys()) + dims, - ) - da.attrs = {"_FillValue": fill_value} - da.name = name - - if crs is not None: - da.raster.set_crs(crs) - - return da - - def create_grid_from_bbox( bbox: List[float], res: float,