Skip to content

Commit

Permalink
Some more priority specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Jan 29, 2025
1 parent 0cca9cb commit 40fb7e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions docs/guide/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@
" Node(6, Point(3.0, 1.0), subnetwork_id=1),\n",
" [\n",
" user_demand.Static(\n",
" demand=[1.5], return_factor=[0.0], min_level=[-1.0], priority=[1]\n",
" demand=[1.5], return_factor=[0.0], min_level=[-1.0], demand_priority=[1]\n",
" )\n",
" ],\n",
")\n",
Expand All @@ -1167,7 +1167,7 @@
" demand=[0.0, 1.0, 1.2, 1.2],\n",
" return_factor=[0.0, 0.0, 0.0, 0.0],\n",
" min_level=[-1.0, -1.0, -1.0, -1.0],\n",
" priority=[1, 1, 2, 2],\n",
" demand_priority=[1, 1, 2, 2],\n",
" time=2 * [\"2020-01-01\", \"2020-01-20\"],\n",
" )\n",
" ],\n",
Expand Down Expand Up @@ -1288,7 +1288,7 @@
")\n",
"df_allocation_wide = df_allocation.pivot_table(\n",
" index=\"time\",\n",
" columns=[\"node_type\", \"node_id\", \"priority\"],\n",
" columns=[\"node_type\", \"node_id\", \"demand_priority\"],\n",
" values=[\"demand\", \"allocated\", \"realized\"],\n",
")\n",
"df_allocation_wide = df_allocation_wide.loc[:, (df_allocation_wide != 0).any(axis=0)]\n",
Expand All @@ -1297,7 +1297,7 @@
"\n",
"df_allocation_wide[\"demand\"].plot(ax=axs[0], ls=\":\")\n",
"df_allocation_wide[\"allocated\"].plot(ax=axs[1], ls=\"--\")\n",
"df_allocation_wide.xs(1, level=\"priority\", axis=1)[\"realized\"].plot(\n",
"df_allocation_wide.xs(1, level=\"demand_priority\", axis=1)[\"realized\"].plot(\n",
" ax=axs[2], color=[\"C0\", \"C2\", \"C3\"]\n",
")\n",
"\n",
Expand Down Expand Up @@ -1443,7 +1443,7 @@
"source": [
"model.level_demand.add(\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",
" [level_demand.Static(demand_priority=[1], min_level=[1.0], max_level=[1.5])],\n",
")"
]
},
Expand All @@ -1464,7 +1464,7 @@
" 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",
" demand_priority=[2], demand=[1.5e-3], return_factor=[0.2], min_level=[0.2]\n",
" )\n",
" ],\n",
")"
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/irrigation-demand.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
" demand=[0.0, 0.0, 10, 12, 12, 0.0],\n",
" return_factor=0,\n",
" min_level=0,\n",
" priority=1,\n",
" demand_priority=1,\n",
" time=[\n",
" starttime,\n",
" \"2022-03-31\",\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/reservoir.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
" demand=[0.0, 0.0, 10, 12, 12, 0.0],\n",
" return_factor=0,\n",
" min_level=0,\n",
" priority=1,\n",
" demand_priority=1,\n",
" time=[\n",
" starttime,\n",
" \"2022-03-31\",\n",
Expand Down Expand Up @@ -197,7 +197,7 @@
" demand=[0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.15, 0.14, 0.12, 0.10, 0.09, 0.08],\n",
" return_factor=0.6,\n",
" min_level=0,\n",
" priority=1,\n",
" demand_priority=1,\n",
" time=pd.date_range(start=\"2022-01-01\", periods=12, freq=\"MS\"),\n",
" )\n",
" ],\n",
Expand Down

0 comments on commit 40fb7e0

Please sign in to comment.