Skip to content

Commit

Permalink
fix auto id conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
  • Loading branch information
nitbharambe committed Jun 26, 2024
1 parent 12b5466 commit 140e0b3
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 59 deletions.
12 changes: 9 additions & 3 deletions src/power_grid_model_io/config/excel/vision_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Number
from_node:
auto_id:
Expand Down Expand Up @@ -226,10 +227,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Transformers
name: transformer
key:
Number: Number
status: 1
Expand All @@ -249,6 +251,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Number
from_node:
auto_id:
Expand Down Expand Up @@ -321,10 +324,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Special transformers
name: transformer
key:
Number: Number
status: 1
Expand Down Expand Up @@ -748,6 +752,7 @@ grid:
three_winding_transformer:
id:
auto_id:
name: three_winding_transformer
key: Number
node_1:
auto_id:
Expand Down Expand Up @@ -852,10 +857,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Three Winding transformers
name: three_winding_transformer
key:
Number: Number
status: 1
Expand Down
12 changes: 9 additions & 3 deletions src/power_grid_model_io/config/excel/vision_en_9_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Number
from_node:
auto_id:
Expand Down Expand Up @@ -227,10 +228,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Transformers
name: transformer
key:
Number: Number
status: State
Expand All @@ -250,6 +252,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Number
from_node:
auto_id:
Expand Down Expand Up @@ -322,10 +325,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Special transformers
name: transformer
key:
Number: Number
status: At
Expand Down Expand Up @@ -749,6 +753,7 @@ grid:
three_winding_transformer:
id:
auto_id:
name: three_winding_transformer
key: Number
node_1:
auto_id:
Expand Down Expand Up @@ -853,10 +858,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Number
regulated_object:
auto_id:
table: Three winding transformers
name: three_winding_transformer
key:
Number: Number
status: 1
Expand Down
12 changes: 9 additions & 3 deletions src/power_grid_model_io/config/excel/vision_nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Nummer
from_node:
auto_id:
Expand Down Expand Up @@ -223,10 +224,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Nummer
regulated_object:
auto_id:
table: Transformatoren
name: transformer
key:
Nummer: Nummer
status: 1
Expand All @@ -246,6 +248,7 @@ grid:
transformer:
id:
auto_id:
name: transformer
key: Nummer
from_node:
auto_id:
Expand Down Expand Up @@ -315,10 +318,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Nummer
regulated_object:
auto_id:
table: Speciale transformatoren
name: transformer
key:
Nummer: Nummer
status: 1
Expand Down Expand Up @@ -739,6 +743,7 @@ grid:
three_winding_transformer:
id:
auto_id:
name: three_winding_transformer
key: Nummer
node_1:
auto_id:
Expand Down Expand Up @@ -840,10 +845,11 @@ grid:
transformer_tap_regulator:
id:
auto_id:
name: transformer_tap_regulator
key: Nummer
regulated_object:
auto_id:
table: Driewikkelingstransformatoren
name: three_winding_transformer
key:
Nummer: Nummer
status: 1
Expand Down
44 changes: 22 additions & 22 deletions tests/data/vision/pgm_input_data_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{"id": 2, "id_reference": {"table": "Nodes", "key": {"Number": 3}}, "Name": "node3"},
{"id": 3, "id_reference": {"table": "Nodes", "key": {"Number": 4}}, "Name": "node4"},
{"id": 4, "id_reference": {"table": "Nodes", "key": {"Number": 5}}},
{"id": 13, "id_reference": {"table": "Transformer loads", "name": "internal_node", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 14, "id_reference": {"table": "Transformer loads", "name": "internal_node", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"}
{"id": 15, "id_reference": {"table": "Transformer loads", "name": "internal_node", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 16, "id_reference": {"table": "Transformer loads", "name": "internal_node", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"}
],
"line":
[
Expand All @@ -21,43 +21,43 @@
],
"transformer":
[
{"id": 9, "from_node": 1, "to_node": 2, "id_reference": {"table": "Transformers", "key": {"Number": 1}}, "Name": "transformer1"},
{"id": 10, "from_node": 1, "to_node": 3, "id_reference": {"table": "Special transformers", "key": {"Number": 1}}, "Name": "special_trans1"},
{"id": 11, "from_node": 2, "to_node": 13, "id_reference": {"table": "Transformer loads", "name": "transformer", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 12, "from_node": 2, "to_node": 14, "id_reference": {"table": "Transformer loads", "name": "transformer", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"}
{"id": 9, "from_node": 1, "to_node": 2, "id_reference": {"table": "Transformers", "name": "transformer", "key": {"Number": 1}}, "Name": "transformer1"},
{"id": 11, "from_node": 1, "to_node": 3, "id_reference": {"table": "Special transformers", "name": "transformer", "key": {"Number": 1}}, "Name": "special_trans1"},
{"id": 13, "from_node": 2, "to_node": 15, "id_reference": {"table": "Transformer loads", "name": "transformer", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 14, "from_node": 2, "to_node": 16, "id_reference": {"table": "Transformer loads", "name": "transformer", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"}
],
"transformer_tap_regulator":
[
{"id": 9, "id_reference": {"table": "Transformers", "key": {"Number": 1}}, "Name": "transformer1"},
{"id": 10, "id_reference": {"table": "Special transformers", "key": {"Number": 1}}, "Name": "special_trans1"},
{"id": 27, "id_reference": {"table": "Three winding transformers", "key": {"Number": 1}}}
{"id": 10, "regulated_object": 9, "id_reference": {"table": "Transformers", "name": "transformer_tap_regulator", "key": {"Number": 1}}, "Name": "transformer1"},
{"id": 12, "regulated_object": 11, "id_reference": {"table": "Special transformers", "name": "transformer_tap_regulator", "key": {"Number": 1}}, "Name": "special_trans1"},
{"id": 30, "regulated_object": 29, "id_reference": {"table": "Three winding transformers", "name": "transformer_tap_regulator", "key": {"Number": 1}}}
],
"sym_load":
[
{"id": 15, "node": 13, "id_reference": {"table": "Transformer loads", "name": "load", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 16, "node": 14, "id_reference": {"table": "Transformer loads", "name": "load", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 22, "node": 2, "id_reference": {"table": "Loads", "key": {"Node.Number": 3, "Subnumber": 6}}, "Name": "load1"}
{"id": 17, "node": 15, "id_reference": {"table": "Transformer loads", "name": "load", "key": {"Node.Number": 3, "Subnumber": 4}}, "Name": "transformer_load_2"},
{"id": 18, "node": 16, "id_reference": {"table": "Transformer loads", "name": "load", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 24, "node": 2, "id_reference": {"table": "Loads", "key": {"Node.Number": 3, "Subnumber": 6}}, "Name": "load1"}
],
"sym_gen":
[
{"id": 17, "node": 14, "id_reference": {"table": "Transformer loads", "name": "generation", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 18, "node": 14, "id_reference": {"table": "Transformer loads", "name": "pv_generation", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 20, "node": 3, "id_reference": {"table": "Synchronous generators", "key": {"Node.Number": 4, "Subnumber": 2}}, "Name": "syngen1"},
{"id": 21, "node": 2, "id_reference": {"table": "Wind turbines", "key": {"Node.Number": 3, "Subnumber": 3}}, "Name": "wind1"},
{"id": 26, "node": 2, "id_reference": {"table": "Pvs", "key": {"Node.Number": 3, "Subnumber": 1}}, "Name": "pv1"}
{"id": 19, "node": 16, "id_reference": {"table": "Transformer loads", "name": "generation", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 20, "node": 16, "id_reference": {"table": "Transformer loads", "name": "pv_generation", "key": {"Node.Number": 3, "Subnumber": 2}}, "Name": "transformer_load_1"},
{"id": 22, "node": 3, "id_reference": {"table": "Synchronous generators", "key": {"Node.Number": 4, "Subnumber": 2}}, "Name": "syngen1"},
{"id": 23, "node": 2, "id_reference": {"table": "Wind turbines", "key": {"Node.Number": 3, "Subnumber": 3}}, "Name": "wind1"},
{"id": 28, "node": 2, "id_reference": {"table": "Pvs", "key": {"Node.Number": 3, "Subnumber": 1}}, "Name": "pv1"}
],
"source":
[
{"id": 19, "node": 0, "id_reference": {"table": "Sources", "key": {"Node.Number": 1, "Subnumber": 1}}, "Name": "source1"}
{"id": 21, "node": 0, "id_reference": {"table": "Sources", "key": {"Node.Number": 1, "Subnumber": 1}}, "Name": "source1"}
],
"shunt":
[
{"id": 23, "node": 2, "id_reference": {"table": "Zigzag transformers", "key": {"Node.Number": 3, "Subnumber": 5}}, "Name": "zztrans1"},
{"id": 24, "node": 3, "id_reference": {"table": "Capacitors", "key": {"Node.Number": 4, "Subnumber": 9}}, "Name": "shunt1"},
{"id": 25, "node": 3, "id_reference": {"table": "Reactors", "key": {"Node.Number": 4, "Subnumber": 1}}}
{"id": 25, "node": 2, "id_reference": {"table": "Zigzag transformers", "key": {"Node.Number": 3, "Subnumber": 5}}, "Name": "zztrans1"},
{"id": 26, "node": 3, "id_reference": {"table": "Capacitors", "key": {"Node.Number": 4, "Subnumber": 9}}, "Name": "shunt1"},
{"id": 27, "node": 3, "id_reference": {"table": "Reactors", "key": {"Node.Number": 4, "Subnumber": 1}}}
],
"three_winding_transformer":
[
{"id": 27, "node_1": 1, "node_2": 2, "node_3": 4, "id_reference": {"table": "Three winding transformers", "key": {"Number": 1}}}
{"id": 29, "node_1": 1, "node_2": 2, "node_3": 4, "id_reference": {"table": "Three winding transformers", "name": "three_winding_transformer", "key": {"Number": 1}}}
]
}
44 changes: 22 additions & 22 deletions tests/data/vision/pgm_input_data_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{"id": 2, "id_reference": {"table": "Knooppunten", "key": {"Nummer": 3}}, "Naam": "node3"},
{"id": 3, "id_reference": {"table": "Knooppunten", "key": {"Nummer": 4}}, "Naam": "node4"},
{"id": 4, "id_reference": {"table": "Knooppunten", "key": {"Nummer": 5}}},
{"id": 13, "id_reference": {"table": "Transformatorbelastingen", "name": "internal_node", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 14, "id_reference": {"table": "Transformatorbelastingen", "name": "internal_node", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"}
{"id": 15, "id_reference": {"table": "Transformatorbelastingen", "name": "internal_node", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 16, "id_reference": {"table": "Transformatorbelastingen", "name": "internal_node", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"}
],
"line":
[
Expand All @@ -21,43 +21,43 @@
],
"transformer":
[
{"id": 9, "from_node": 1, "to_node": 2, "id_reference": {"table": "Transformatoren", "key": {"Nummer": 1}}, "Naam": "transformer1"},
{"id": 10, "from_node": 1, "to_node": 3, "id_reference": {"table": "Speciale transformatoren", "key": {"Nummer": 1}}, "Naam": "special_trans1"},
{"id": 11, "from_node": 2, "to_node": 13, "id_reference": {"table": "Transformatorbelastingen", "name": "transformer", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 12, "from_node": 2, "to_node": 14, "id_reference": {"table": "Transformatorbelastingen", "name": "transformer", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"}
{"id": 9, "from_node": 1, "to_node": 2, "id_reference": {"table": "Transformatoren", "name": "transformer", "key": {"Nummer": 1}}, "Naam": "transformer1"},
{"id": 11, "from_node": 1, "to_node": 3, "id_reference": {"table": "Speciale transformatoren", "name": "transformer", "key": {"Nummer": 1}}, "Naam": "special_trans1"},
{"id": 13, "from_node": 2, "to_node": 15, "id_reference": {"table": "Transformatorbelastingen", "name": "transformer", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 14, "from_node": 2, "to_node": 16, "id_reference": {"table": "Transformatorbelastingen", "name": "transformer", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"}
],
"transformer_tap_regulator":
[
{"id": 9, "id_reference": {"table": "Transformatoren", "key": {"Nummer": 1}}, "Naam": "transformer1"},
{"id": 10, "id_reference": {"table": "Speciale transformatoren", "key": {"Nummer": 1}}, "Naam": "special_trans1"},
{"id": 27, "id_reference": {"table": "Driewikkelingstransformatoren", "key": {"Nummer": 1}}}
{"id": 10, "regulated_object": 9, "id_reference": {"table": "Transformatoren", "name": "transformer_tap_regulator", "key": {"Nummer": 1}}, "Naam": "transformer1"},
{"id": 12, "regulated_object": 11, "id_reference": {"table": "Speciale transformatoren", "name": "transformer_tap_regulator", "key": {"Nummer": 1}}, "Naam": "special_trans1"},
{"id": 30, "regulated_object": 29, "id_reference": {"table": "Driewikkelingstransformatoren", "name": "transformer_tap_regulator", "key": {"Nummer": 1}}}
],
"sym_load":
[
{"id": 15, "node": 13, "id_reference": {"table": "Transformatorbelastingen", "name": "load", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 16, "node": 14, "id_reference": {"table": "Transformatorbelastingen", "name": "load", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 22, "node": 2, "id_reference": {"table": "Belastingen", "key": {"Knooppunt.Nummer": 3, "Subnummer": 6}}, "Naam": "load1"}
{"id": 17, "node": 15, "id_reference": {"table": "Transformatorbelastingen", "name": "load", "key": {"Knooppunt.Nummer": 3, "Subnummer": 4}}, "Naam": "transformer_load_2"},
{"id": 18, "node": 16, "id_reference": {"table": "Transformatorbelastingen", "name": "load", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 24, "node": 2, "id_reference": {"table": "Belastingen", "key": {"Knooppunt.Nummer": 3, "Subnummer": 6}}, "Naam": "load1"}
],
"sym_gen":
[
{"id": 17, "node": 14, "id_reference": {"table": "Transformatorbelastingen", "name": "generation", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 18, "node": 14, "id_reference": {"table": "Transformatorbelastingen", "name": "pv_generation", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 20, "node": 3, "id_reference": {"table": "Synchrone generatoren", "key": {"Knooppunt.Nummer": 4, "Subnummer": 2}}, "Naam": "syngen1"},
{"id": 21, "node": 2, "id_reference": {"table": "Windturbines", "key": {"Knooppunt.Nummer": 3, "Subnummer": 3}}, "Naam": "wind1"},
{"id": 26, "node": 2, "id_reference": {"table": "Pv's", "key": {"Knooppunt.Nummer": 3, "Subnummer": 1}}, "Naam": "pv1"}
{"id": 19, "node": 16, "id_reference": {"table": "Transformatorbelastingen", "name": "generation", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 20, "node": 16, "id_reference": {"table": "Transformatorbelastingen", "name": "pv_generation", "key": {"Knooppunt.Nummer": 3, "Subnummer": 2}}, "Naam": "transformer_load_1"},
{"id": 22, "node": 3, "id_reference": {"table": "Synchrone generatoren", "key": {"Knooppunt.Nummer": 4, "Subnummer": 2}}, "Naam": "syngen1"},
{"id": 23, "node": 2, "id_reference": {"table": "Windturbines", "key": {"Knooppunt.Nummer": 3, "Subnummer": 3}}, "Naam": "wind1"},
{"id": 28, "node": 2, "id_reference": {"table": "Pv's", "key": {"Knooppunt.Nummer": 3, "Subnummer": 1}}, "Naam": "pv1"}
],
"source":
[
{"id": 19, "node": 0, "id_reference": {"table": "Netvoedingen", "key": {"Knooppunt.Nummer": 1, "Subnummer": 1}}, "Naam": "source1"}
{"id": 21, "node": 0, "id_reference": {"table": "Netvoedingen", "key": {"Knooppunt.Nummer": 1, "Subnummer": 1}}, "Naam": "source1"}
],
"shunt":
[
{"id": 23, "node": 2, "id_reference": {"table": "Nulpuntstransformatoren", "key": {"Knooppunt.Nummer": 3, "Subnummer": 5}}, "Naam": "zztrans1"},
{"id": 24, "node": 3, "id_reference": {"table": "Condensatoren", "key": {"Knooppunt.Nummer": 4, "Subnummer": 9}}, "Naam": "shunt1"},
{"id": 25, "node": 3, "id_reference": {"table": "Spoelen", "key": {"Knooppunt.Nummer": 4, "Subnummer": 1}}}
{"id": 25, "node": 2, "id_reference": {"table": "Nulpuntstransformatoren", "key": {"Knooppunt.Nummer": 3, "Subnummer": 5}}, "Naam": "zztrans1"},
{"id": 26, "node": 3, "id_reference": {"table": "Condensatoren", "key": {"Knooppunt.Nummer": 4, "Subnummer": 9}}, "Naam": "shunt1"},
{"id": 27, "node": 3, "id_reference": {"table": "Spoelen", "key": {"Knooppunt.Nummer": 4, "Subnummer": 1}}}
],
"three_winding_transformer":
[
{"id": 27, "node_1": 1, "node_2": 2, "node_3": 4, "id_reference": {"table": "Driewikkelingstransformatoren", "key": {"Nummer": 1}}}
{"id": 29, "node_1": 1, "node_2": 2, "node_3": 4, "id_reference": {"table": "Driewikkelingstransformatoren", "name": "three_winding_transformer", "key": {"Nummer": 1}}}
]
}
Loading

0 comments on commit 140e0b3

Please sign in to comment.