power-grid-model-io 1.3.17__py3-none-any.whl → 1.3.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of power-grid-model-io might be problematic. Click here for more details.
- power_grid_model_io/converters/pandapower_converter.py +44 -68
- {power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/METADATA +1 -1
- {power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/RECORD +6 -6
- {power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/WHEEL +0 -0
- {power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/licenses/LICENSE +0 -0
- {power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/top_level.txt +0 -0
|
@@ -342,13 +342,13 @@ class PandaPowerConverter(BaseConverter[PandaPowerData]):
|
|
|
342
342
|
self._pp_buses_output()
|
|
343
343
|
self._pp_lines_output()
|
|
344
344
|
self._pp_ext_grids_output()
|
|
345
|
-
self.
|
|
345
|
+
self._pp_load_elements_output(element="load", symmetric=True)
|
|
346
|
+
self._pp_load_elements_output(element="ward", symmetric=True)
|
|
347
|
+
self._pp_load_elements_output(element="motor", symmetric=True)
|
|
346
348
|
self._pp_shunts_output()
|
|
347
349
|
self._pp_trafos_output()
|
|
348
350
|
self._pp_sgens_output()
|
|
349
351
|
self._pp_trafos3w_output()
|
|
350
|
-
self._pp_ward_output()
|
|
351
|
-
self._pp_motor_output()
|
|
352
352
|
self._pp_asym_gens_output()
|
|
353
353
|
self._pp_asym_loads_output()
|
|
354
354
|
# Switches derive results from branches pp_output_data and pgm_output_data of links. Hence, placed in the end.
|
|
@@ -360,13 +360,14 @@ class PandaPowerConverter(BaseConverter[PandaPowerData]):
|
|
|
360
360
|
Furthermore, creates a global node lookup table, which stores nodes' voltage magnitude per unit and the voltage
|
|
361
361
|
angle in degrees
|
|
362
362
|
"""
|
|
363
|
-
# TODO create output_data_3ph for
|
|
364
|
-
# Although Pandapower itself did not implmenet res_shunt_3ph
|
|
365
|
-
# Since results are avaiable in PGM output, these should be converted.
|
|
363
|
+
# TODO create output_data_3ph for trafos3w, switches
|
|
366
364
|
self._pp_buses_output_3ph()
|
|
367
365
|
self._pp_lines_output_3ph()
|
|
368
366
|
self._pp_ext_grids_output_3ph()
|
|
369
|
-
self.
|
|
367
|
+
self._pp_load_elements_output(element="load", symmetric=False)
|
|
368
|
+
self._pp_load_elements_output(element="ward", symmetric=False)
|
|
369
|
+
self._pp_load_elements_output(element="motor", symmetric=False)
|
|
370
|
+
self._pp_shunts_output_3ph()
|
|
370
371
|
self._pp_trafos_output_3ph()
|
|
371
372
|
self._pp_sgens_output_3ph()
|
|
372
373
|
self._pp_asym_gens_output_3ph()
|
|
@@ -1560,64 +1561,35 @@ class PandaPowerConverter(BaseConverter[PandaPowerData]):
|
|
|
1560
1561
|
|
|
1561
1562
|
self.pp_output_data["res_asymmetric_sgen"] = pp_output_asym_gens
|
|
1562
1563
|
|
|
1563
|
-
def
|
|
1564
|
+
def _pp_load_elements_output(self, element, symmetric):
|
|
1564
1565
|
"""
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1566
|
+
Utility function to convert output of elements represented as load
|
|
1567
|
+
in power grid model.
|
|
1568
|
+
element: "load", "motor" or "ward"
|
|
1569
|
+
symmetric: True or False
|
|
1569
1570
|
"""
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
ComponentType.sym_load not in self.pgm_output_data
|
|
1575
|
-
or self.pgm_output_data[ComponentType.sym_load].size == 0
|
|
1576
|
-
or ("load", load_id_names[0]) not in self.idx
|
|
1577
|
-
):
|
|
1578
|
-
return
|
|
1579
|
-
|
|
1580
|
-
# Store the results, while assuring that we are not overwriting any data
|
|
1581
|
-
assert "res_load" not in self.pp_output_data
|
|
1582
|
-
self.pp_output_data["res_load"] = self._pp_load_result_accumulate(
|
|
1583
|
-
pp_component_name="load", load_id_names=load_id_names
|
|
1584
|
-
)
|
|
1585
|
-
|
|
1586
|
-
def _pp_ward_output(self):
|
|
1587
|
-
load_id_names = ["ward_const_power_load", "ward_const_impedance_load"]
|
|
1588
|
-
assert "res_ward" not in self.pp_output_data
|
|
1589
|
-
|
|
1590
|
-
if (
|
|
1591
|
-
ComponentType.sym_load not in self.pgm_output_data
|
|
1592
|
-
or self.pgm_output_data[ComponentType.sym_load].size == 0
|
|
1593
|
-
or ("ward", load_id_names[0]) not in self.idx
|
|
1594
|
-
):
|
|
1595
|
-
return
|
|
1596
|
-
|
|
1597
|
-
accumulated_loads = self._pp_load_result_accumulate(pp_component_name="ward", load_id_names=load_id_names)
|
|
1598
|
-
# TODO Find a better way for mapping vm_pu from bus
|
|
1599
|
-
# accumulated_loads["vm_pu"] = np.nan
|
|
1600
|
-
|
|
1601
|
-
# Store the results, while assuring that we are not overwriting any data
|
|
1602
|
-
assert "res_ward" not in self.pp_output_data
|
|
1603
|
-
self.pp_output_data["res_ward"] = accumulated_loads
|
|
1604
|
-
|
|
1605
|
-
def _pp_motor_output(self):
|
|
1606
|
-
load_id_names = ["motor_load"]
|
|
1571
|
+
if symmetric:
|
|
1572
|
+
res_table = "res_" + element
|
|
1573
|
+
else:
|
|
1574
|
+
res_table = "res_" + element + "_3ph"
|
|
1607
1575
|
|
|
1608
|
-
|
|
1576
|
+
if element == "load":
|
|
1577
|
+
load_id_names = ["const_power", "const_impedance", "const_current"]
|
|
1578
|
+
elif element == "ward":
|
|
1579
|
+
load_id_names = ["ward_const_power_load", "ward_const_impedance_load"]
|
|
1580
|
+
elif element == "motor":
|
|
1581
|
+
load_id_names = ["motor_load"]
|
|
1609
1582
|
|
|
1610
1583
|
if (
|
|
1611
1584
|
ComponentType.sym_load not in self.pgm_output_data
|
|
1612
1585
|
or self.pgm_output_data[ComponentType.sym_load].size == 0
|
|
1613
|
-
or (
|
|
1586
|
+
or (element, load_id_names[0]) not in self.idx
|
|
1614
1587
|
):
|
|
1615
1588
|
return
|
|
1616
|
-
|
|
1617
1589
|
# Store the results, while assuring that we are not overwriting any data
|
|
1618
|
-
assert
|
|
1619
|
-
self.pp_output_data[
|
|
1620
|
-
pp_component_name=
|
|
1590
|
+
assert res_table not in self.pp_output_data
|
|
1591
|
+
self.pp_output_data[res_table] = self._pp_load_result_accumulate(
|
|
1592
|
+
pp_component_name=element, load_id_names=load_id_names
|
|
1621
1593
|
)
|
|
1622
1594
|
|
|
1623
1595
|
def _pp_load_result_accumulate(self, pp_component_name: str, load_id_names: List[str]) -> pd.DataFrame:
|
|
@@ -2131,26 +2103,30 @@ class PandaPowerConverter(BaseConverter[PandaPowerData]):
|
|
|
2131
2103
|
assert "res_trafo_3ph" not in self.pp_output_data
|
|
2132
2104
|
self.pp_output_data["res_trafo_3ph"] = pp_output_trafos_3ph
|
|
2133
2105
|
|
|
2134
|
-
def
|
|
2106
|
+
def _pp_shunts_output_3ph(self):
|
|
2135
2107
|
"""
|
|
2136
|
-
This function converts a power-grid-model
|
|
2108
|
+
This function converts a power-grid-model Shunt output array to a Shunt Dataframe of PandaPower.
|
|
2137
2109
|
|
|
2138
2110
|
Returns:
|
|
2139
|
-
a PandaPower Dataframe for the
|
|
2111
|
+
a PandaPower Dataframe for the Shunt component
|
|
2140
2112
|
"""
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
or ("load", load_id_names[0]) not in self.idx
|
|
2146
|
-
):
|
|
2113
|
+
# TODO: create unit tests for the function
|
|
2114
|
+
assert "res_shunt_3ph" not in self.pp_output_data
|
|
2115
|
+
|
|
2116
|
+
if ComponentType.shunt not in self.pgm_output_data or self.pgm_output_data[ComponentType.shunt].size == 0:
|
|
2147
2117
|
return
|
|
2148
2118
|
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2119
|
+
pgm_output_shunts = self.pgm_output_data[ComponentType.shunt]
|
|
2120
|
+
|
|
2121
|
+
pp_output_shunts = pd.DataFrame(
|
|
2122
|
+
columns=["p_mw", "q_mvar", "vm_pu"],
|
|
2123
|
+
index=self._get_pp_ids("shunt", pgm_output_shunts["id"]),
|
|
2153
2124
|
)
|
|
2125
|
+
pp_output_shunts["p_mw"] = pgm_output_shunts["p"].sum() * 1e-6
|
|
2126
|
+
pp_output_shunts["q_mvar"] = pgm_output_shunts["q"].sum() * 1e-6
|
|
2127
|
+
# TODO Find a better way for mapping vm_pu from bus
|
|
2128
|
+
# pp_output_shunts["vm_pu"] = np.nan
|
|
2129
|
+
self.pp_output_data["res_shunt_3ph"] = pp_output_shunts
|
|
2154
2130
|
|
|
2155
2131
|
def _pp_asym_loads_output_3ph(self):
|
|
2156
2132
|
"""
|
|
@@ -10,7 +10,7 @@ power_grid_model_io/config/excel/vision_en_9_8.yaml,sha256=yCa4v5VUK1xCZ0PrHG2Zf
|
|
|
10
10
|
power_grid_model_io/config/excel/vision_nl.yaml,sha256=0IOh5Ug9QwP2dgNMsl90RARV_v-xxcA6rv8Ya0WCPuI,21426
|
|
11
11
|
power_grid_model_io/converters/__init__.py,sha256=qng1-O8kfpgalPms_C_zAwBuiuKUoquf27u6JkVH-9k,487
|
|
12
12
|
power_grid_model_io/converters/base_converter.py,sha256=ifF-U1kmJIW9Tj9uW7d0XJlsBrmvpUZoi3WxNPAbKO4,6170
|
|
13
|
-
power_grid_model_io/converters/pandapower_converter.py,sha256=
|
|
13
|
+
power_grid_model_io/converters/pandapower_converter.py,sha256=sxtKymhic8Bka4fMoAWGw8WMQQYDDWjlNi96ALyUr68,117827
|
|
14
14
|
power_grid_model_io/converters/pgm_json_converter.py,sha256=7Z1Qmoxn0qo4fkLXvmNTWNMHOJHhnyGTvxlRlcHbMLg,14210
|
|
15
15
|
power_grid_model_io/converters/tabular_converter.py,sha256=XmUDVthYyJQiHXxzspVCjUo3ZGsv4XXwZ_VRQLn4bvs,35666
|
|
16
16
|
power_grid_model_io/converters/vision_excel_converter.py,sha256=hiEOqXgfM3XbHDJ-ri-Os2a4Dh5lZFqF0m9_YFBaYs4,4166
|
|
@@ -43,8 +43,8 @@ power_grid_model_io/utils/modules.py,sha256=DJLmYKt9cV_GvqJI8wkXppNycqD4b8n5-o_8
|
|
|
43
43
|
power_grid_model_io/utils/parsing.py,sha256=cw6d3S89BvB8dncN0SeFHDhFG7ZlDNx9iGYWjZk5fVU,4684
|
|
44
44
|
power_grid_model_io/utils/uuid_excel_cvtr.py,sha256=FFsfnvELVTkIXE_qfEPjFlphsikAr7GyjnNwsDZ-AgY,7581
|
|
45
45
|
power_grid_model_io/utils/zip.py,sha256=VXHX4xWPPZbhOlZUAbMDy3MgQFzK6_l7sRvGXihNUY4,3875
|
|
46
|
-
power_grid_model_io-1.3.
|
|
47
|
-
power_grid_model_io-1.3.
|
|
48
|
-
power_grid_model_io-1.3.
|
|
49
|
-
power_grid_model_io-1.3.
|
|
50
|
-
power_grid_model_io-1.3.
|
|
46
|
+
power_grid_model_io-1.3.19.dist-info/licenses/LICENSE,sha256=7Pm2fWFFHHUG5lDHed1vl5CjzxObIXQglnYsEdtjo_k,14907
|
|
47
|
+
power_grid_model_io-1.3.19.dist-info/METADATA,sha256=oecbH02RW_apZqZ4GQMrrSd3_brPUe4FkmcUD_cFnMM,8196
|
|
48
|
+
power_grid_model_io-1.3.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
49
|
+
power_grid_model_io-1.3.19.dist-info/top_level.txt,sha256=7sq9VveemMm2R0RgTBa4tH8y_xF4_1hxbufmX9OjCTo,20
|
|
50
|
+
power_grid_model_io-1.3.19.dist-info/RECORD,,
|
|
File without changes
|
{power_grid_model_io-1.3.17.dist-info → power_grid_model_io-1.3.19.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|