Skip to content

Commit

Permalink
update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
hboisgon committed Oct 18, 2024
1 parent 94498e9 commit a9c4283
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 59 deletions.
10 changes: 7 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down Expand Up @@ -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 <https://github.com/Deltares/hydromt_wflow/pull/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
Expand Down
4 changes: 2 additions & 2 deletions hydromt_wflow/wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
54 changes: 0 additions & 54 deletions hydromt_wflow/workflows/demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit a9c4283

Please sign in to comment.