From 7f4b3cd7075d70c7b0ca2585757f06789058235b Mon Sep 17 00:00:00 2001 From: Christian Biasuzzi Date: Wed, 4 Sep 2024 11:29:35 +0200 Subject: [PATCH] fixes demo notebook Signed-off-by: Christian Biasuzzi --- examples/demo_mapviewer_features.ipynb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/demo_mapviewer_features.ipynb b/examples/demo_mapviewer_features.ipynb index 29fab7c..a2a57ee 100644 --- a/examples/demo_mapviewer_features.ipynb +++ b/examples/demo_mapviewer_features.ipynb @@ -135,20 +135,16 @@ "four_substations_network.create_dangling_lines(id='d1', voltage_level_id='S4VL1', node=1, p0=10, q0=3, r=0, x=5, g=0, b=1e-6)\n", "four_substations_network.create_dangling_lines(id='d2', voltage_level_id='S5VL1', bus_id='S5VL1B1', p0=10, q0=3, r=0, x=5, g=0, b=1e-6)\n", "four_substations_network.create_tie_lines(id='t1', dangling_line1_id='d1', dangling_line2_id='d2')\n", - "voltage_levels = four_substations_network.get_voltage_levels()\n", - "voltage_levels['name']=voltage_levels.index\n", "coords = pd.DataFrame(\n", " [\n", - " [voltage_levels.loc[voltage_levels[\"name\"] == \"S1VL1\", \"substation_id\"].iloc[0], 2.9653506942899255, 46.648820589226624],\n", - " [voltage_levels.loc[voltage_levels[\"name\"] == \"S2VL1\", \"substation_id\"].iloc[0], 4.4868965299190675, 45.224159481986970],\n", - " [voltage_levels.loc[voltage_levels[\"name\"] == \"S3VL1\", \"substation_id\"].iloc[0], 2.4022589283484335, 44.090773206380350],\n", - " [voltage_levels.loc[voltage_levels[\"name\"] == \"S4VL1\", \"substation_id\"].iloc[0], 6.0803264207747825, 44.279779791063575],\n", - " [voltage_levels.loc[voltage_levels[\"name\"] == \"S5VL1\", \"substation_id\"].iloc[0], 7.4221621183374900, 44.279779791063575]\n", - " ], columns=[\"id\", \"longitude\", \"latitude\"]\n", - ").set_index(\"id\")\n", - "\n", - "four_substations_network.remove_extensions('substationPosition', four_substations_network.get_extensions('substationPosition').index)\n", - "four_substations_network.create_extensions('substationPosition', coords[[\"latitude\", \"longitude\"]])\n", + " ['S1', 2.9653506942899255, 46.648820589226624],\n", + " ['S2', 4.4868965299190675, 45.224159481986970],\n", + " ['S3', 2.4022589283484335, 44.090773206380350],\n", + " ['S4', 6.0803264207747825, 44.279779791063575],\n", + " ['S5', 7.4221621183374900, 44.279779791063575]\n", + " ], columns=['id', 'longitude', 'latitude']\n", + ").set_index('id')\n", + "four_substations_network.create_extensions('substationPosition', coords[['latitude', 'longitude']])\n", "\n", "network_map3=NetworkMapWidget(four_substations_network)\n", "display(network_map3)"