Skip to content

Commit 511052f

Browse files
committed
update examples with python3.13 and pandapower3.1
Signed-off-by: Martijn Govers <[email protected]>
1 parent 0681fe2 commit 511052f

File tree

8 files changed

+854
-190
lines changed

8 files changed

+854
-190
lines changed

docs/examples/arrow_example.ipynb

Lines changed: 138 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@
120120
"In this example, we use the respective primitive types for the symmetrical attributes and a `FixedSizeListArray` of the primitive types with length 3 for asymmetrical attributes. This results in them being stored as contiguous memory which would enable zero-copy conversion. Other possible workarounds to this are possible, but are beyond the scope of this example."
121121
]
122122
},
123-
{
124-
"cell_type": "code",
125-
"execution_count": null,
126-
"metadata": {},
127-
"outputs": [],
128-
"source": []
129-
},
130123
{
131124
"cell_type": "markdown",
132125
"metadata": {},
@@ -146,10 +139,10 @@
146139
"name": "stdout",
147140
"output_type": "stream",
148141
"text": [
149-
"-------node scehma-------\n",
142+
"-------node schema-------\n",
150143
"id: int32\n",
151144
"u_rated: double\n",
152-
"-------asym load scehma-------\n",
145+
"-------asym load schema-------\n",
153146
"id: int32\n",
154147
"node: int32\n",
155148
"status: int8\n",
@@ -292,7 +285,8 @@
292285
{
293286
"data": {
294287
"text/plain": [
295-
"{'id': array([1, 2, 3]), 'u_rated': array([10500., 10500., 10500.])}"
288+
"{'id': array([1, 2, 3], dtype=int32),\n",
289+
" 'u_rated': array([10500., 10500., 10500.])}"
296290
]
297291
},
298292
"execution_count": 5,
@@ -373,6 +367,87 @@
373367
"outputs": [
374368
{
375369
"data": {
370+
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
371+
"columns": [
372+
{
373+
"name": "index",
374+
"rawType": "int64",
375+
"type": "integer"
376+
},
377+
{
378+
"name": "id",
379+
"rawType": "int32",
380+
"type": "integer"
381+
},
382+
{
383+
"name": "energized",
384+
"rawType": "int8",
385+
"type": "integer"
386+
},
387+
{
388+
"name": "u_pu",
389+
"rawType": "float64",
390+
"type": "float"
391+
},
392+
{
393+
"name": "u",
394+
"rawType": "float64",
395+
"type": "float"
396+
},
397+
{
398+
"name": "u_angle",
399+
"rawType": "float64",
400+
"type": "float"
401+
},
402+
{
403+
"name": "p",
404+
"rawType": "float64",
405+
"type": "float"
406+
},
407+
{
408+
"name": "q",
409+
"rawType": "float64",
410+
"type": "float"
411+
}
412+
],
413+
"ref": "e0a1569d-3e2d-49e8-9326-80be633fd4da",
414+
"rows": [
415+
[
416+
"0",
417+
"1",
418+
"1",
419+
"1.000324825742982",
420+
"10503.410670301311",
421+
"-6.651843181518038e-05",
422+
"338777.2462788448",
423+
"-3299418.661306348"
424+
],
425+
[
426+
"1",
427+
"2",
428+
"1",
429+
"1.0028788641128945",
430+
"10530.228073185392",
431+
"-0.0029317915196012487",
432+
"-1.0000002693184182",
433+
"-0.5000000701801947"
434+
],
435+
[
436+
"2",
437+
"3",
438+
"1",
439+
"1.004112854674026",
440+
"10543.184974077272",
441+
"-0.004341587216862092",
442+
"-1.9999998867105226",
443+
"-1.4999998507078594"
444+
]
445+
],
446+
"shape": {
447+
"columns": 7,
448+
"rows": 3
449+
}
450+
},
376451
"text/html": [
377452
"<div>\n",
378453
"<style scoped>\n",
@@ -608,8 +683,8 @@
608683
{
609684
"data": {
610685
"text/plain": [
611-
"{'id': array([7, 8]),\n",
612-
" 'node': array([2, 3]),\n",
686+
"{'id': array([7, 8], dtype=int32),\n",
687+
" 'node': array([2, 3], dtype=int32),\n",
613688
" 'status': array([1, 1], dtype=int8),\n",
614689
" 'type': array([0, 0], dtype=int8),\n",
615690
" 'p_specified': array([[1.0e+00, 1.0e-02, 1.1e-02],\n",
@@ -664,6 +739,55 @@
664739
"outputs": [
665740
{
666741
"data": {
742+
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
743+
"columns": [
744+
{
745+
"name": "index",
746+
"rawType": "int64",
747+
"type": "integer"
748+
},
749+
{
750+
"name": "0",
751+
"rawType": "float64",
752+
"type": "float"
753+
},
754+
{
755+
"name": "1",
756+
"rawType": "float64",
757+
"type": "float"
758+
},
759+
{
760+
"name": "2",
761+
"rawType": "float64",
762+
"type": "float"
763+
}
764+
],
765+
"ref": "582802e2-e012-4e14-9c47-0157e97ec045",
766+
"rows": [
767+
[
768+
"0",
769+
"-6.651848125694397e-05",
770+
"-2.094461573665813",
771+
"2.09432849798745"
772+
],
773+
[
774+
"1",
775+
"-0.0029298831864832267",
776+
"-2.0973219974462594",
777+
"2.0914640024381836"
778+
],
779+
[
780+
"2",
781+
"-0.004337685507209373",
782+
"-2.098732840554144",
783+
"2.0900574062078014"
784+
]
785+
],
786+
"shape": {
787+
"columns": 3,
788+
"rows": 3
789+
}
790+
},
667791
"text/html": [
668792
"<div>\n",
669793
"<style scoped>\n",
@@ -827,7 +951,7 @@
827951
],
828952
"metadata": {
829953
"kernelspec": {
830-
"display_name": ".venv",
954+
"display_name": "venv",
831955
"language": "python",
832956
"name": "python3"
833957
},
@@ -841,7 +965,7 @@
841965
"name": "python",
842966
"nbconvert_exporter": "python",
843967
"pygments_lexer": "ipython3",
844-
"version": "3.12.0"
968+
"version": "3.13.3"
845969
},
846970
"orig_nbformat": 4
847971
},
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
22
"node":
33
[
4-
{"id": 0, "u_rated": 110000.0, "id_reference": {"table": "bus", "index": 101}},
5-
{"id": 1, "u_rated": 20000.0, "id_reference": {"table": "bus", "index": 102}},
6-
{"id": 2, "u_rated": 20000.0, "id_reference": {"table": "bus", "index": 103}},
7-
{"id": 3, "u_rated": 30100.0, "id_reference": {"table": "bus", "index": 104}},
8-
{"id": 4, "u_rated": 60000.0, "id_reference": {"table": "bus", "index": 105}},
9-
{"id": 5, "u_rated": 110000.0, "id_reference": {"table": "bus", "index": 106}}
4+
{"id": 0, "u_rated": 110000, "id_reference": {"table": "bus", "index": 101}},
5+
{"id": 1, "u_rated": 20000, "id_reference": {"table": "bus", "index": 102}},
6+
{"id": 2, "u_rated": 20000, "id_reference": {"table": "bus", "index": 103}},
7+
{"id": 3, "u_rated": 30100, "id_reference": {"table": "bus", "index": 104}},
8+
{"id": 4, "u_rated": 60000, "id_reference": {"table": "bus", "index": 105}},
9+
{"id": 5, "u_rated": 110000, "id_reference": {"table": "bus", "index": 106}}
1010
],
1111
"line":
1212
[
13-
{"id": 6, "from_node": 2, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.12792, "x1": 0.0492, "c1": 6.4206e-07, "tan1": 0.0, "i_n": 108.0, "id_reference": {"table": "line", "index": 101}, "pgm_input": {"from_node": 2, "to_node": 1, "i_n": 108.0}}
13+
{"id": 6, "from_node": 2, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.12792, "x1": 0.0492, "c1": 6.4206e-07, "tan1": 0, "i_n": 108, "id_reference": {"table": "line", "index": 101}, "pgm_input": {"from_node": 2, "to_node": 1, "i_n": 108.0}}
1414
],
1515
"source":
1616
[
17-
{"id": 7, "node": 0, "status": 1, "u_ref": 1.0, "u_ref_angle": 0.0, "sk": 1e+16, "rx_ratio": 0.0, "id_reference": {"table": "ext_grid", "index": 1}, "pgm_input": {"node": 0}}
17+
{"id": 7, "node": 0, "status": 1, "u_ref": 1, "u_ref_angle": 0, "sk": 10000000000000000, "rx_ratio": 0, "id_reference": {"table": "ext_grid", "index": 1}, "pgm_input": {"node": 0}}
1818
],
1919
"sym_load":
2020
[
21-
{"id": 8, "node": 2, "status": 1, "type": 0, "p_specified": 575000.0, "q_specified": 55200.0, "id_reference": {"table": "load", "name": "const_power", "index": 101}, "pgm_input": {"node": 2}},
22-
{"id": 9, "node": 2, "status": 1, "type": 1, "p_specified": 1275000.0, "q_specified": 122400.0, "id_reference": {"table": "load", "name": "const_impedance", "index": 101}, "pgm_input": {"node": 2}},
23-
{"id": 10, "node": 2, "status": 1, "type": 2, "p_specified": 650000.0, "q_specified": 62400.0, "id_reference": {"table": "load", "name": "const_current", "index": 101}, "pgm_input": {"node": 2}},
24-
{"id": 18, "node": 4, "status": 1, "type": 0, "p_specified": 100000.0, "q_specified": 100000.0, "id_reference": {"table": "ward", "name": "ward_const_power_load", "index": 34}, "pgm_input": {"node": 4}},
25-
{"id": 19, "node": 4, "status": 1, "type": 1, "p_specified": 100000.0, "q_specified": 100000.0, "id_reference": {"table": "ward", "name": "ward_const_impedance_load", "index": 34}, "pgm_input": {"node": 4}},
21+
{"id": 8, "node": 2, "status": 1, "type": 0, "p_specified": 575000, "q_specified": 55200, "id_reference": {"table": "load", "name": "const_power", "index": 101}, "pgm_input": {"node": 2}},
22+
{"id": 9, "node": 2, "status": 1, "type": 1, "p_specified": 1275000, "q_specified": 122400, "id_reference": {"table": "load", "name": "const_impedance", "index": 101}, "pgm_input": {"node": 2}},
23+
{"id": 10, "node": 2, "status": 1, "type": 2, "p_specified": 650000, "q_specified": 62400, "id_reference": {"table": "load", "name": "const_current", "index": 101}, "pgm_input": {"node": 2}},
24+
{"id": 18, "node": 4, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 100000, "id_reference": {"table": "ward", "name": "ward_const_power_load", "index": 34}, "pgm_input": {"node": 4}},
25+
{"id": 19, "node": 4, "status": 1, "type": 1, "p_specified": 100000, "q_specified": 100000, "id_reference": {"table": "ward", "name": "ward_const_impedance_load", "index": 34}, "pgm_input": {"node": 4}},
2626
{"id": 20, "node": 4, "status": 1, "type": 0, "p_specified": 71111.11111111111, "q_specified": 34440.68301069173, "id_reference": {"table": "motor", "name": "motor_load", "index": 12}, "pgm_input": {"node": 4}}
2727
],
2828
"shunt":
@@ -31,26 +31,26 @@
3131
],
3232
"transformer":
3333
[
34-
{"id": 12, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "u1": 110000.0, "u2": 20000.0, "sn": 80000000.0, "uk": 0.17800000000000002, "pk": 8176000.0, "i0": 0.03, "p0": 23200.0, "winding_from": 2, "winding_to": 1, "clock": 1, "tap_side": 0, "tap_pos": 2, "tap_min": -1, "tap_max": 3, "tap_nom": 1, "tap_size": 2200.0, "id_reference": {"table": "trafo", "index": 101}, "pgm_input": {"from_node": 0, "to_node": 1}, "pp_input": {"df": 1.0}}
34+
{"id": 12, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "u1": 110000, "u2": 20000, "sn": 80000000, "uk": 0.17800000000000002, "pk": 8176000, "i0": 0.03, "p0": 23200, "winding_from": 2, "winding_to": 1, "clock": 1, "tap_side": 0, "tap_pos": 2, "tap_min": -1, "tap_max": 3, "tap_nom": 1, "tap_size": 2200, "id_reference": {"table": "trafo", "index": 101}, "pgm_input": {"from_node": 0, "to_node": 1}, "pp_input": {"df": 1.0}}
3535
],
3636
"sym_gen":
3737
[
38-
{"id": 13, "node": 4, "status": 1, "type": 0, "p_specified": 1210000.0, "q_specified": 810000.0, "id_reference": {"table": "sgen", "index": 31}, "pgm_input": {"node": 4}}
38+
{"id": 13, "node": 4, "status": 1, "type": 0, "p_specified": 1210000, "q_specified": 810000, "id_reference": {"table": "sgen", "index": 31}, "pgm_input": {"node": 4}}
3939
],
4040
"three_winding_transformer":
4141
[
42-
{"id": 14, "node_1": 2, "node_2": 4, "node_3": 3, "status_1": 1, "status_2": 1, "status_3": 1, "u1": 20000.0, "u2": 60000.0, "u3": 30100.0, "sn_1": 40000000.0, "sn_2": 100000000.0, "sn_3": 50000000.0, "uk_12": 0.1, "uk_13": 0.12, "uk_23": 0.11, "pk_12": 400000.0, "pk_13": 1600000.0, "pk_23": 1000000.0, "i0": 0.001, "p0": 10000.0, "winding_1": 2, "winding_2": 1, "winding_3": 0, "clock_12": 1, "clock_13": 1, "tap_side": 2, "tap_pos": 2, "tap_min": 1, "tap_max": 3, "tap_nom": 2, "tap_size": 903.0, "id_reference": {"table": "trafo3w", "index": 102}, "pgm_input": {"node_1": 2, "node_2": 4, "node_3": 3}}
42+
{"id": 14, "node_1": 2, "node_2": 4, "node_3": 3, "status_1": 1, "status_2": 1, "status_3": 1, "u1": 20000, "u2": 60000, "u3": 30100, "sn_1": 40000000, "sn_2": 100000000, "sn_3": 50000000, "uk_12": 0.1, "uk_13": 0.12, "uk_23": 0.11, "pk_12": 400000, "pk_13": 1600000, "pk_23": 1000000, "i0": 0.001, "p0": 10000, "winding_1": 2, "winding_2": 1, "winding_3": 0, "clock_12": 1, "clock_13": 1, "tap_side": 2, "tap_pos": 2, "tap_min": 1, "tap_max": 3, "tap_nom": 2, "tap_size": 903, "id_reference": {"table": "trafo3w", "index": 102}, "pgm_input": {"node_1": 2, "node_2": 4, "node_3": 3}}
4343
],
4444
"link":
4545
[
4646
{"id": 15, "from_node": 0, "to_node": 5, "from_status": 1, "to_status": 1, "id_reference": {"table": "switch", "name": "b2b_switches", "index": 3021}, "pgm_input": {"from_node": 0, "to_node": 5}}
4747
],
4848
"asym_load":
4949
[
50-
{"id": 16, "node": 4, "status": 1, "type": 0, "p_specified": [100000.0, 200000.0, 3000000.0], "q_specified": [10000.0, 10000.0, 10000.0], "id_reference": {"table": "asymmetric_load", "index": 33}, "pgm_input": {"node": 4}}
50+
{"id": 16, "node": 4, "status": 1, "type": 0, "p_specified": [100000, 200000, 3000000], "q_specified": [10000, 10000, 10000], "id_reference": {"table": "asymmetric_load", "index": 33}, "pgm_input": {"node": 4}}
5151
],
5252
"asym_gen":
5353
[
54-
{"id": 17, "node": 4, "status": 1, "type": 0, "p_specified": [100000.0, 200000.0, 3000000.0], "q_specified": [10000.0, 10000.0, 10000.0], "id_reference": {"table": "asymmetric_sgen", "index": 32}, "pgm_input": {"node": 4}}
54+
{"id": 17, "node": 4, "status": 1, "type": 0, "p_specified": [100000, 200000, 3000000], "q_specified": [10000, 10000, 10000], "id_reference": {"table": "asymmetric_sgen", "index": 32}, "pgm_input": {"node": 4}}
5555
]
5656
}

0 commit comments

Comments
 (0)