Skip to content

Commit

Permalink
Revert some of the jupyter note book that got carried over by mistake
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
  • Loading branch information
Jerry-Jinfeng-Guo committed Jan 12, 2024
1 parent 9514ac7 commit c37c1d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 50 deletions.
67 changes: 18 additions & 49 deletions docs/examples/pandapower_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,7 @@
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\AL29065\\AppData\\Local\\miniconda3\\envs\\power-grid-io-env\\lib\\site-packages\\pandapower\\create.py:4815: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'Dyn' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n",
" net[element_type].at[index, column] = value\n"
]
}
],
"outputs": [],
"source": [
"%%capture cap --no-stderr\n",
"\n",
Expand All @@ -113,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -160,7 +151,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -181,7 +172,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -210,8 +201,6 @@
" <th>u_pu</th>\n",
" <th>u</th>\n",
" <th>u_angle</th>\n",
" <th>p</th>\n",
" <th>q</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
Expand All @@ -222,8 +211,6 @@
" <td>1.000000</td>\n",
" <td>109999.999962</td>\n",
" <td>-1.798666e-10</td>\n",
" <td>1.798666e+06</td>\n",
" <td>3.476629e+06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
Expand All @@ -232,8 +219,6 @@
" <td>0.973746</td>\n",
" <td>19474.919873</td>\n",
" <td>-5.239008e-01</td>\n",
" <td>1.408570e-07</td>\n",
" <td>-3.370807e-07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
Expand All @@ -242,8 +227,6 @@
" <td>0.973014</td>\n",
" <td>19460.275746</td>\n",
" <td>-5.237224e-01</td>\n",
" <td>-2.414573e+06</td>\n",
" <td>-2.317990e+05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
Expand All @@ -252,8 +235,6 @@
" <td>0.969550</td>\n",
" <td>29183.446690</td>\n",
" <td>-1.045187e+00</td>\n",
" <td>-8.295649e-08</td>\n",
" <td>1.430200e-07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
Expand All @@ -262,8 +243,6 @@
" <td>0.971998</td>\n",
" <td>58319.874965</td>\n",
" <td>-1.044829e+00</td>\n",
" <td>9.444109e+05</td>\n",
" <td>5.810813e+05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
Expand All @@ -272,29 +251,19 @@
" <td>1.000000</td>\n",
" <td>109999.999962</td>\n",
" <td>-1.798666e-10</td>\n",
" <td>0.000000e+00</td>\n",
" <td>-0.000000e+00</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id energized u_pu u u_angle p \\\n",
"0 0 1 1.000000 109999.999962 -1.798666e-10 1.798666e+06 \n",
"1 1 1 0.973746 19474.919873 -5.239008e-01 1.408570e-07 \n",
"2 2 1 0.973014 19460.275746 -5.237224e-01 -2.414573e+06 \n",
"3 3 1 0.969550 29183.446690 -1.045187e+00 -8.295649e-08 \n",
"4 4 1 0.971998 58319.874965 -1.044829e+00 9.444109e+05 \n",
"5 5 1 1.000000 109999.999962 -1.798666e-10 0.000000e+00 \n",
"\n",
" q \n",
"0 3.476629e+06 \n",
"1 -3.370807e-07 \n",
"2 -2.317990e+05 \n",
"3 1.430200e-07 \n",
"4 5.810813e+05 \n",
"5 -0.000000e+00 "
" id energized u_pu u u_angle\n",
"0 0 1 1.000000 109999.999962 -1.798666e-10\n",
"1 1 1 0.973746 19474.919873 -5.239008e-01\n",
"2 2 1 0.973014 19460.275746 -5.237224e-01\n",
"3 3 1 0.969550 29183.446690 -1.045187e+00\n",
"4 4 1 0.971998 58319.874965 -1.044829e+00\n",
"5 5 1 1.000000 109999.999962 -1.798666e-10"
]
},
"metadata": {},
Expand All @@ -320,7 +289,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -348,14 +317,14 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"from power_grid_model_io.converters import PgmJsonConverter\n",
" \n",
"input_file = \"data/pandapower/example_simple_input_test.json\"\n",
"output_file = \"data/pandapower/example_simple_output_test.json\"\n",
"input_file = \"data/pandapower/example_simple_input.json\"\n",
"output_file = \"data/pandapower/example_simple_output.json\"\n",
"\n",
"PgmJsonConverter(destination_file=input_file).save(data=input_data, extra_info=extra_info)\n",
"PgmJsonConverter(destination_file=output_file).save(data=output_data, extra_info=extra_info)"
Expand All @@ -377,7 +346,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -482,7 +451,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -737,7 +706,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.9"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion src/power_grid_model_io/converters/pandapower_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2389,4 +2389,4 @@ def lookup_id(self, pgm_id: int) -> Dict[str, Union[str, int]]:
if name:
return {"table": table, "name": name, "index": indices[pgm_id]}
return {"table": table, "index": indices[pgm_id]}
raise KeyError(pgm_id)
raise KeyError(pgm_id)

0 comments on commit c37c1d6

Please sign in to comment.