Skip to content

Commit

Permalink
Fix minor issues Dommel workflow (#199)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Tollenaar <[email protected]>
  • Loading branch information
visr and DanielTollenaar authored Dec 20, 2024
1 parent c2cc6ae commit 8769b49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions notebooks/de_dommel/01_fix_model_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

cloud = CloudStorage()

authority = "BrabantseDelta"
short_name = "wbd"
authority = "DeDommel"

ribasim_toml = cloud.joinpath(authority, "modellen", f"{authority}_2024_6_3", f"{short_name}.toml")
ribasim_toml = cloud.joinpath(authority, "modellen", f"{authority}_2024_6_3", "model.toml")


basin_data = [
Expand Down Expand Up @@ -205,7 +204,7 @@
for node_id in df.from_node_id:
model.update_node(node_id, "Outlet", [outlet.Static(flow_rate=[100])])

# # see: https://github.com/Deltares/Ribasim-NL/issues/132
# see: https://github.com/Deltares/Ribasim-NL/issues/132
model.basin.area.df.loc[model.basin.area.df.duplicated("node_id"), ["node_id"]] = -1
model.basin.area.df.reset_index(drop=True, inplace=True)
model.basin.area.df.index.name = "fid"
Expand Down
6 changes: 3 additions & 3 deletions notebooks/de_dommel/02_fix_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
data += [row]
continue

gpd.GeoDataFrame(data, crs=28992).to_file("rare_edges.gpkg")
out_dir = cloud.joinpath("DeDommel", "modellen", "DeDommel_fix_edges")
gpd.GeoDataFrame(data, crs=28992).to_file(out_dir / "rare_edges.gpkg")

# %% write model
ribasim_toml = cloud.joinpath("DeDommel", "modellen", "DeDommel_fix_edges", "model.toml")
model.write(ribasim_toml)
model.write(out_dir / "model.toml")
2 changes: 1 addition & 1 deletion notebooks/de_dommel/03_fix_basin_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ribasim_toml = cloud.joinpath("DeDommel", "modellen", "DeDommel_fix_edges", "model.toml")
model = Model.read(ribasim_toml)


# TODO file not in the cloud
area_gdf = gpd.read_file(cloud.joinpath("DeDommel", "verwerkt", "watervlakken", "LWW_2023_A_water_vlak_V.shp"))


Expand Down

0 comments on commit 8769b49

Please sign in to comment.