From 8d84add22612d01dbbddcb054930bc6aeebb884c Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 16 Apr 2024 15:45:48 +0200 Subject: [PATCH] Define subnetwork --- docs/python/examples.ipynb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/python/examples.ipynb b/docs/python/examples.ipynb index 5a76e3ae7..d184f3059 100644 --- a/docs/python/examples.ipynb +++ b/docs/python/examples.ipynb @@ -1448,7 +1448,7 @@ " basin.State(level=[0.5]),\n", "]\n", "model.basin.add(\n", - " Node(2, Point(1.0, 0.0)),\n", + " Node(2, Point(1.0, 0.0), subnetwork_id=2),\n", " [\n", " *basin_data,\n", " basin.Time(\n", @@ -1462,7 +1462,7 @@ " ],\n", ")\n", "model.basin.add(\n", - " Node(5, Point(2.0, -1.0)),\n", + " Node(5, Point(2.0, -1.0), subnetwork_id=2),\n", " [\n", " *basin_data,\n", " basin.Static(\n", @@ -1473,9 +1473,6 @@ " urban_runoff=[0.0],\n", " ),\n", " ],\n", - ")\n", - "profile = pd.DataFrame(\n", - " data={\"node_id\": [2, 2, 5, 5], \"area\": 1e3, \"level\": [0.0, 1.0, 0.0, 1.0]}\n", ")" ] }, @@ -1493,7 +1490,7 @@ "outputs": [], "source": [ "model.flow_boundary.add(\n", - " Node(1, Point(0.0, 0.0)), [flow_boundary.Static(flow_rate=[1e-3])]\n", + " Node(1, Point(0.0, 0.0), subnetwork_id=2), [flow_boundary.Static(flow_rate=[1e-3])]\n", ")" ] }, @@ -1501,7 +1498,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Setup allocation level control:\n" + "Setup level demand:\n" ] }, { @@ -1511,7 +1508,7 @@ "outputs": [], "source": [ "model.level_demand.add(\n", - " Node(4, Point(1.0, -1.0)),\n", + " Node(4, Point(1.0, -1.0), subnetwork_id=2),\n", " [level_demand.Static(priority=[1], min_level=[1.0], max_level=[1.5])],\n", ")" ] @@ -1530,7 +1527,7 @@ "outputs": [], "source": [ "model.user_demand.add(\n", - " Node(3, Point(2.0, 0.0)),\n", + " Node(3, Point(2.0, 0.0), subnetwork_id=2),\n", " [\n", " user_demand.Static(\n", " priority=[2], demand=[1.5e-3], return_factor=[0.2], min_level=[0.2]\n",