@@ -360,15 +360,18 @@ def _create_output_data_3ph(self):
360360 Furthermore, creates a global node lookup table, which stores nodes' voltage magnitude per unit and the voltage
361361 angle in degrees
362362 """
363- # TODO create output_data_3ph for remaining components
363+ # TODO create output_data_3ph for trafos3w
364364 # Although Pandapower itself did not implmenet res_shunt_3ph
365365 # Since results are avaiable in PGM output, these should be converted.
366366 self ._pp_buses_output_3ph ()
367367 self ._pp_lines_output_3ph ()
368368 self ._pp_ext_grids_output_3ph ()
369369 self ._pp_loads_output_3ph ()
370+ self ._pp_shunts_output_3ph ()
370371 self ._pp_trafos_output_3ph ()
371372 self ._pp_sgens_output_3ph ()
373+ self ._pp_ward_output_3ph ()
374+ self ._pp_motor_output_3ph ()
372375 self ._pp_asym_gens_output_3ph ()
373376 self ._pp_asym_loads_output_3ph ()
374377
@@ -2154,6 +2157,68 @@ def _pp_loads_output_3ph(self):
21542157 pp_component_name = "load" , load_id_names = load_id_names
21552158 )
21562159
2160+ def _pp_ward_output_3ph (self ):
2161+ # TODO: Create Unit tests
2162+ load_id_names = ["ward_const_power_load" , "ward_const_impedance_load" ]
2163+ if (
2164+ ComponentType .sym_load not in self .pgm_output_data
2165+ or self .pgm_output_data [ComponentType .sym_load ].size == 0
2166+ or ("ward" , load_id_names [0 ]) not in self .idx
2167+ ):
2168+ return
2169+
2170+ # TODO Find a better way for mapping vm_pu from bus
2171+ # accumulated_loads["vm_pu"] = np.nan
2172+ # Store the results, while assuring that we are not overwriting any data
2173+ assert "res_ward_3ph" not in self .pp_output_data
2174+ self .pp_output_data ["res_ward_3ph" ] = self ._pp_load_result_accumulate (
2175+ pp_component_name = "ward" , load_id_names = load_id_names
2176+ )
2177+
2178+ def _pp_motor_output_3ph (self ):
2179+ # TODO: Create unit tests
2180+ load_id_names = ["motor_load" ]
2181+
2182+ assert "res_motor_3ph" not in self .pp_output_data
2183+
2184+ if (
2185+ ComponentType .sym_load not in self .pgm_output_data
2186+ or self .pgm_output_data [ComponentType .sym_load ].size == 0
2187+ or ("motor" , load_id_names [0 ]) not in self .idx
2188+ ):
2189+ return
2190+
2191+ # Store the results, while assuring that we are not overwriting any data
2192+ assert "res_motor" not in self .pp_output_data
2193+ self .pp_output_data ["res_motor_3ph" ] = self ._pp_load_result_accumulate (
2194+ pp_component_name = "motor" , load_id_names = load_id_names
2195+ )
2196+
2197+ def _pp_shunts_output_3ph (self ):
2198+ """
2199+ This function converts a power-grid-model Shunt output array to a Shunt Dataframe of PandaPower.
2200+
2201+ Returns:
2202+ a PandaPower Dataframe for the Shunt component
2203+ """
2204+ # TODO: create unit tests for the function
2205+ assert "res_shunt_3ph" not in self .pp_output_data
2206+
2207+ if ComponentType .shunt not in self .pgm_output_data or self .pgm_output_data [ComponentType .shunt ].size == 0 :
2208+ return
2209+
2210+ pgm_output_shunts = self .pgm_output_data [ComponentType .shunt ]
2211+
2212+ pp_output_shunts = pd .DataFrame (
2213+ columns = ["p_mw" , "q_mvar" , "vm_pu" ],
2214+ index = self ._get_pp_ids ("shunt" , pgm_output_shunts ["id" ]),
2215+ )
2216+ pp_output_shunts ["p_mw" ] = pgm_output_shunts ["p" ].sum () * 1e-6
2217+ pp_output_shunts ["q_mvar" ] = pgm_output_shunts ["q" ].sum () * 1e-6
2218+ # TODO Find a better way for mapping vm_pu from bus
2219+ # pp_output_shunts["vm_pu"] = np.nan
2220+ self .pp_output_data ["res_shunt_3ph" ] = pp_output_shunts
2221+
21572222 def _pp_asym_loads_output_3ph (self ):
21582223 """
21592224 This function converts a power-grid-model Asymmetrical Load output array to an Asymmetrical Load Dataframe of
0 commit comments