Skip to content

Commit

Permalink
update check for tap phase shifter for pandapower v3.0
Browse files Browse the repository at this point in the history
Signed-off-by: AzureAD\PanagiotisXenos <[email protected]>
  • Loading branch information
AzureAD\PanagiotisXenos authored and AzureAD\PanagiotisXenos committed Dec 19, 2024
1 parent cf9ec82 commit 94f5e16
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lightsim2grid/gridmodel/from_pandapower/_aux_add_trafo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ def _aux_add_trafo(converter, model, pp_net, pp_to_ls):
warnings.warn("There were some Nan in the pp_net.trafo[\"tap_side\"], they have been replaced by \"hv\"")
is_tap_hv_side[~np.isfinite(is_tap_hv_side)] = True

if int(pp.__version__.split(".")[0]) < 3:
if "tap_phase_shifter" in pp_net.trafo:
if np.any(pp_net.trafo["tap_phase_shifter"].values):
raise RuntimeError("Ideal phase shifters are not modeled. Please remove all trafos with "
"pp_net.trafo[\"tap_phase_shifter\"] set to True.")
else:
if np.any(pp_net.trafo["tap_changer_type"].values == "Ideal") or \
np.any(pp_net.trafo3w["tap_changer_type"].values == "Ideal"):
raise RuntimeError("Ideal phase shifters are not modeled. Please remove all 2-winding or 3-winding trafos "
elif "tap_changer_type" in pp_net.trafo:
if np.any(pp_net.trafo["tap_changer_type"].values == "Ideal"):
raise RuntimeError("Ideal phase shifters are not modeled. Please remove all 2-winding trafos "
"with \"tap_changer_type\" set to \"Ideal\".")
elif "tap_changer_type" in pp_net.trafo3w:
if np.any(pp_net.trafo3w["tap_changer_type"].values == "Ideal"):
raise RuntimeError("Ideal phase shifters are not modeled. Please remove all 3-winding trafos "
"with \"tap_changer_type\" set to \"Ideal\".")

tap_angles_ = 1.0 * pp_net.trafo["tap_step_degree"].values
Expand Down

0 comments on commit 94f5e16

Please sign in to comment.