From ee45178a044c9645fe85282cb4c0c135a6592036 Mon Sep 17 00:00:00 2001 From: Daniel Tollenaar Date: Tue, 20 Aug 2024 16:02:41 +0200 Subject: [PATCH] Update modify_model.py --- notebooks/de_dommel/modify_model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notebooks/de_dommel/modify_model.py b/notebooks/de_dommel/modify_model.py index 7c870e2..d549f20 100644 --- a/notebooks/de_dommel/modify_model.py +++ b/notebooks/de_dommel/modify_model.py @@ -189,14 +189,16 @@ 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.fix_unassigned_basin_area() model.fix_unassigned_basin_area(method="closest", distance=100) model.fix_unassigned_basin_area() model.basin.area.df = model.basin.area.df[~model.basin.area.df.node_id.isin(model.unassigned_basin_area.node_id)] -# %% write model +# # %% write model ribasim_toml = ribasim_toml.parents[1].joinpath("DeDommel", ribasim_toml.name) model.write(ribasim_toml)