Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for pandapower v3.0 #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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