Skip to content

Commit

Permalink
Afbouwen wdod vechtstromen (#163)
Browse files Browse the repository at this point in the history
Alle verbeteringen aan model-klasse voor het debuggen van Vechtstromen
en WDOD

---------

Co-authored-by: Martijn Visser <[email protected]>
  • Loading branch information
DanielTollenaar and visr authored Oct 11, 2024
1 parent 6f39f95 commit 71b67e6
Show file tree
Hide file tree
Showing 13 changed files with 1,744 additions and 13 deletions.
28 changes: 28 additions & 0 deletions notebooks/basin_area_nodes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# %%

import pandas as pd
from ribasim_nl import CloudStorage, Model

cloud = CloudStorage()


# %%
data = []
for authority in cloud.water_authorities:
ribasim_toml = cloud.joinpath(authority, "modellen", f"{authority}_2024_6_3", "model.toml")
if ribasim_toml.exists():
model = Model.read(ribasim_toml)
data += [
{
"waterschap": authority,
"basin_nodes": len(model.basin.node.df),
"basin_areas": len(model.basin.area.df),
"basin_verschil": abs(len(model.basin.node.df) - len(model.basin.area.df)),
"basin_area_lt_5000m2": len(model.basin.area.df[model.basin.area.df.area < 5000]),
}
]

df = pd.DataFrame(data)


df.to_excel(cloud.joinpath("verschil_basins.xlsx"), index=False)
4 changes: 2 additions & 2 deletions notebooks/de_dommel/00_get_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

cloud = CloudStorage()

dommel_url = cloud.joinurl("DeDommel", "modellen", "DeDommel_2024_6_3")
model_url = cloud.joinurl("DeDommel", "modellen", "DeDommel_2024_6_3")

# %%
cloud.download_content(dommel_url)
cloud.download_content(model_url)
4 changes: 2 additions & 2 deletions notebooks/de_dommel/00_get_verwerkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

cloud = CloudStorage()

dommel_url = cloud.joinurl("DeDommel", "verwerkt")
data_url = cloud.joinurl("DeDommel", "verwerkt")

# %%
cloud.download_content(dommel_url)
cloud.download_content(data_url)
15 changes: 15 additions & 0 deletions notebooks/drents_overijsselse_delta/00_get_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# %%
from ribasim_nl import CloudStorage

authority = "DrentsOverijsselseDelta"
short_name = "dod"

cloud = CloudStorage()

model_url = cloud.joinurl(authority, "modellen", f"{authority}_2024_6_3")

cloud.download_content(model_url)

ribasim_toml = cloud.joinpath(authority, "modellen", f"{authority}_2024_6_3", "model.toml")
if ribasim_toml.exists():
ribasim_toml.rename(ribasim_toml.with_name(f"{short_name}.toml"))
9 changes: 9 additions & 0 deletions notebooks/drents_overijsselse_delta/00_get_verwerkt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# %%
from ribasim_nl import CloudStorage

cloud = CloudStorage()

data_url = cloud.joinurl("DeDommel", "verwerkt")

# %%
cloud.download_content(data_url)
Loading

0 comments on commit 71b67e6

Please sign in to comment.