Skip to content

Commit

Permalink
Merge pull request #99 from panos-xenos/update_pandapower_v3
Browse files Browse the repository at this point in the history
Update for pandapower v3.0
  • Loading branch information
BDonnot authored Feb 4, 2025
2 parents e7ccf69 + 94f5e16 commit dffd73b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lightsim2grid/gridmodel/from_pandapower/_aux_add_trafo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ 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 np.any(pp_net.trafo["tap_phase_shifter"].values):
raise RuntimeError("ideal phase shifter are not modeled. Please remove all trafo with "
"pp_net.trafo[\"tap_phase_shifter\"] set to True.")
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.")
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
if np.any(~np.isfinite(tap_angles_)):
Expand Down

0 comments on commit dffd73b

Please sign in to comment.