Skip to content

Commit 0f25d01

Browse files
KS-HTKjwiemer112mrifraunhofervogt31337brynpickering
authored
Feature/merge develop (#2998)
* updated docstings (#2934) deprecated unused keyword args * Feature/get all elements (#2939) * Hallo * Hallo Leute * adding first draft of simple_hl_plot a function to easily highlight buses and lines paired with a hover functionality * added function to get a dataframe of all elements in the net * add test clean comments renaming * add test * add docu * add changelog entry * ltds_fix (#2938) * updated ltds notebooks * updated ltds notebooks, fixed LTDS converter * added pytest split to tutorial_test pipeline (#2935) * added pytest split to tutorial_test pipeline * added notebook test times * fixed many links (#2937) other formatting Co-authored-by: V3 <mike.vogt@iee.fraunhofer.de> * Fix copyright text formatting in LICENSE file (#2914) * Fix copyright text formatting in LICENSE file * Refactor copyright notice in LICENSE Updated copyright notice formatting in LICENSE file following [upstream changes](licensee/licensee#950) to handle multi-line attribution. --------- Co-authored-by: KS_HTK <2981026+KS-HTK@users.noreply.github.com> * added PowerElectronicsConnection to the LTDS converter, updated LTDS notebooks (PowerElectronicsConnection) (#2942) Co-authored-by: David Heck <david.heck@iee.fraunhofer.de> * ltds_pce (#2944) * added PowerElectronicsConnection to the LTDS converter, updated LTDS notebooks (PowerElectronicsConnection) * updated LTDS notebooks for mapping Excel data * ltds_notebook (#2949) * updated ltds notebooks * updated LTDS notebooks for mapping Excel data * updated LTDS notebooks for mapping Excel data * ltds_notebook (#2950) * updated ltds notebooks * updated LTDS notebooks for mapping Excel data * updated LTDS notebooks for mapping Excel data * UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * Feature check vkr percent (#2948) * added check to check if vkr_percent values are reasonable. * added changelog entry. --------- Co-authored-by: KS_HTK <2981026+KS-HTK@users.noreply.github.com> * Feature additional diagnostic functions (#2952) * added more diagnostic functions. * added changelog entry. * fixed a small bug, used the wrong value in the reactance field. * Correct loading_percent description in motor_par.csv (#2947) Updated the description of loading_percent. * ucte2pp conversion fixes (#2823) * consider empty R dataframe in ucte conversion * convert impedances and trafos with G/B=NaN to G/B=0 * change fillna for trafos and impedances to the ucte_parser * fillna df if 0 * fix nan values in impedances and trafos * ucte2pp: averaging voltages and clean up parser * changelog entries for ucte2pp fixes * average voltage setpoints using topological search instead of ucte name * empty space at EOF * fix codacy issue * remove create_switch from pp_import_functions * fix create_vsc functions * changelog :) * change symmetrical tap changer to 90 degree tap step degree * correct handling of symmetrical PSTs in ucte2pp * comment averaging function based on PR review * changes ucte converter * ucte2pp: add flag for voltage harmonization, with default false * fix test * fix tests and restrict tolerances a bit --------- Co-authored-by: mrichter <mario.richter@iee.fraunhofer.de> Co-authored-by: V3 <mike.vogt@iee.fraunhofer.de> * Fix 2733 (#2951) * change patch sizes for plot (#2733) * fix patch sizes for plot only once (#2733) `get_collection_sizes()` takes arguments to adjust the relative size of an element. --------- Co-authored-by: V3 <mike.vogt@iee.fraunhofer.de> * Fix runopp(init="results") so the OPF solver preserves the model initial vector (#2902) * Fix runopp(init=results) warm-start handling in pips OPF * Update CHANGELOG for upcoming release fixes and features --------- Co-authored-by: jereOG <jerelang@users.noreply.github.com> Co-authored-by: V3 <mike.vogt@iee.fraunhofer.de> * Feature/highlight plot (#2833) * integrated highlighting feature into simple_plot * integrated hover feature into simple_plot * update plotting tutorial * adjust color * Fix unit g0_us (#2958) attribute name g0_us_per_km is incorrectly named as g0_nf_per_km in add_zero_impedance_parameters function. * updated branding with versions from marketing (#2953) * [IMPROVEMENT] fix `bool` parameters input in `read_excel` and add `add_basic_std_types` parameter (#2961) * Add basic std types flag to from_excel Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Fix reading bool Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Fix backward compatibility Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Silence sonarcloud and codacy Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Remove ruff ignore --------- Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * added permissions block to all workflows (#2964) * updated the issue templates to use the issue types instead of labels and title (#2966) minor changes in forms layouts * Feature/revised issue templates (#2967) * updated the issue templates to use the issue types instead of labels and title minor changes in forms layouts * fix for config not parsing by github (hopefully) added documentation template added emoji to template title for more visual guidance * uniform formatting for templates * added missing blank line at end of file * display logger message only if GetActiveScenario() isn't None (#2969) Only display a logger message if GetActiveScenario is not None Added else case with a info message if no study case / scenario is active. * Update docstring (#2970) Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * ltds_notebook (#2972) * updated ltds notebooks * updated LTDS notebooks for mapping Excel data * updated LTDS notebooks for mapping Excel data * UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * Update lightsim2grid version (#2976) Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * fix cmin for low voltage 10% tolerance (#2913) * fix(cmin): fix cmin for low voltage 10% tolerance * [Fix] Fix `reindex_buses` against creating duplicate indecies (#2963) * Fix reindex_buses Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Add allow_duplicate_index argument Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Fix unused import Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Fix test Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> --------- Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * feature/doc strings update (#2979) * added/reformatted many docstrings * added show_plot=False to test_plotting_toolbox * refactored docstrings and added types * fixed f-string in groups.py * fixed incorrect type * fixed incorrect type * fixed missing import * fixed import issue with specific lightsim2grid versions * fixed mypy issues in contingency refactored test in test_contingency * fixed mypy issues * updated var name * updated the contributing.rst (#2973) * updated the contributing.rst * removed raw directive * changed contributing to markdown for better github compatibility replaced contributing on readTheDocs by link to GitHub * Added a section on changelog to the contributing.md Added a changelog entry to the changelog * Update CHANGELOG.rst * [Feature]: Toggle Colormap for simple_plot (#2971) * colormap-integration in simple_plot * adjust colors *add docstrings *add second button to better visualize options for the user * change ext_grid color * some formatting * only plot colormap if buses or lines are available (fix tutorial-test error) * removed some spaces removed some whitelines added results to hover info * add changelog entry * adepted authors * adapted zorder make plotting bus-switches optional * typo * small adaptions * small adjustments --------- Co-authored-by: KS_HTK <2981026+KS-HTK@users.noreply.github.com> * ltds_notebook (#2980) * updated ltds notebooks * updated LTDS notebooks for mapping Excel data * updated LTDS notebooks for mapping Excel data * UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * fix UKPN Jupiter Notebook * update LTDS Jupiter Notebook respecting new Excel format --------- Co-authored-by: David Heck <david.heck@iee.fraunhofer.de> * Fix diagnostic report (#2983) Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Tutorials for UKPN (#2984) * Fix tutorial on power flow * Updated Jupyter notebooks for UKPN * Fix on tutorial directory * [Fix] `DiscreteTapControl` to work with negative `tap_step_percent` (#2990) * abs tap_step_percent Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Add changelog, test case Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * Remove code duplication Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> --------- Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> * updated the notebook to ignore warnings instead of capturing all output and only displaying specifics. (#2996) * voltage dependend loads create differing results (#2991) * fixed issue with voltage dependent loads. * fixed typo in import * removed unused imports * Fixed test now failing due to nan instead of 0 for in_service=False * reenabled voltage_depend_loads for most tests --------- Signed-off-by: furqan463 <ahmadfurqanc@gmail.com> Co-authored-by: Jan Wiemer <32835953+jwiemer112@users.noreply.github.com> Co-authored-by: mrifraunhofer <94368111+mrifraunhofer@users.noreply.github.com> Co-authored-by: V3 <mike.vogt@iee.fraunhofer.de> Co-authored-by: Bryn Pickering <17178478+brynpickering@users.noreply.github.com> Co-authored-by: David Heck <david.heck@iee.fraunhofer.de> Co-authored-by: Arisaka97 <solitaire2312@gmail.com> Co-authored-by: pawellytaev <86314586+pawellytaev@users.noreply.github.com> Co-authored-by: mrichter <mario.richter@iee.fraunhofer.de> Co-authored-by: Moritz <29129441+MoritzHauff@users.noreply.github.com> Co-authored-by: Jeremias Lang <158100420+jerelang@users.noreply.github.com> Co-authored-by: jereOG <jerelang@users.noreply.github.com> Co-authored-by: Engr. Ahmad Furqan <ahmadfurqanc@gmail.com> Co-authored-by: nis-nurr <rijad.nuridini@nis.ch> Co-authored-by: marcopau <77792704+marcopau@users.noreply.github.com>
1 parent 4f44e90 commit 0f25d01

13 files changed

Lines changed: 178 additions & 184 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Change Log
77

88
[upcoming release] - 2026-..-..
99
-------------------------------
10+
- [CHANGED] differing behavior for :code:`in_service=False` depending on `voltage_depend_loads` has been fixed. Out of Service elements for res_bus now always contain `nan` as result.
1011
- [FIXED] `DiscreteTapControl` to work with `negative tap_step_percent`.
1112
- [CHANGED] updated the contributing file and documentation
1213
- [ADDED] `allow_duplicate_index` parameter to `reindex_buses` with default to `false`.

pandapower/auxiliary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,15 +1569,15 @@ def SVabc_from_SV012(
15691569
def _add_dcline_gens(net: pandapowerNet) -> None:
15701570
"""
15711571
For each HVDC Link create consumption and supply generator
1572-
1572+
15731573
Parameters:
15741574
net: network to add the generators to
15751575
15761576
Returns:
15771577
None
15781578
"""
15791579
from pandapower.create import create_gen
1580-
1580+
15811581
for dctab in net.dcline.itertuples():
15821582
p_mw = np.abs(dctab.p_mw)
15831583
p_loss = p_mw * (1 - dctab.loss_percent / 100) - dctab.loss_mw # type: ignore[operator]

pandapower/contingency/contingency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
except ImportError:
4343
KLU_solver_available = False
4444

45-
from pandapower.auxiliary import pandapowerNet
45+
from pandapower.network import pandapowerNet
4646
from pandapower.create._utils import add_column_to_df
4747
from pandapower.run import runpp
4848

pandapower/converter/ucte/from_ucte.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import time
99
from pandapower.converter.ucte.ucte_converter import UCTE2pandapower
1010
from pandapower.converter.ucte.ucte_parser import UCTEParser
11-
from pandapower import pandapowerNet
11+
from pandapower.network import pandapowerNet
1212
from pandapower.toolbox import get_connected_buses
1313

1414
logger = logging.getLogger('ucte.from_ucte')

pandapower/create/cost_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import numpy as np
1212
import numpy.typing as npt
1313

14-
from pandapower import pandapowerNet
14+
from pandapower.network import pandapowerNet
1515
from pandapower.pp_types import Int, CostElementType, PWLPowerType
1616
from pandapower.create._utils import (
1717
_cost_existance_check,

pandapower/results.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
# Copyright (c) 2016-2026 by University of Kassel and Fraunhofer Institute for Energy Economics
42
# and Energy System Technology (IEE), Kassel. All rights reserved.
53

@@ -8,7 +6,7 @@
86
import numpy as np
97
import pandas as pd
108

11-
from pandapower.auxiliary import get_vsc_stacked_names
9+
from pandapower.auxiliary import get_vsc_stacked_names, pandapowerNet
1210
from pandapower.results_branch import _get_branch_results, _get_branch_results_3ph
1311
from pandapower.results_bus import _get_bus_results, _get_bus_dc_results, _set_buses_out_of_service, \
1412
_get_shunt_results, _get_p_q_results, _get_bus_v_results, _get_bus_v_results_3ph, _get_p_q_results_3ph, \
@@ -27,6 +25,11 @@
2725
suffix_mode = {"sc": "sc", "se": "est", "pf_3ph": "3ph"}
2826

2927

28+
def _overwrite_out_of_service(net: pandapowerNet) -> None:
29+
net.res_bus[~net.bus.in_service] = np.nan
30+
# TODO: add other out of service elements
31+
32+
3033
def _extract_results(net, ppc):
3134
_set_buses_out_of_service(ppc) # for NaN results in net.res_bus for inactive buses
3235
_set_dc_buses_out_of_service(ppc) # for NaN results in net.res_bus_dc for inactive buses
@@ -44,6 +47,7 @@ def _extract_results(net, ppc):
4447
# _get_branch_dc_results(net, ppc, bus_dc_lookup_aranged, bus_p_dc) # not needed since it is calculated in _get_branch_results
4548
_get_bus_dc_results(net, bus_p_dc)
4649
_get_vsc_stacked_results(net)
50+
_overwrite_out_of_service(net)
4751
if net._options["mode"] == "opf":
4852
_get_costs(net, ppc)
4953
else:

pandapower/results_bus.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# -*- coding: utf-8 -*-
2-
from typing import Any
3-
41
# Copyright (c) 2016-2026 by University of Kassel and Fraunhofer Institute for Energy Economics
52
# and Energy System Technology (IEE), Kassel. All rights reserved.
63

4+
from typing import Any
75

86
import numpy as np
97
import pandas as pd
@@ -25,6 +23,7 @@
2523

2624
def _set_buses_out_of_service(ppc):
2725
disco = np.nonzero(ppc["bus"][:, BUS_TYPE] == NONE)[BUS_I]
26+
#ppc["bus"][disco, 2:] = np.nan
2827
ppc["bus"][disco, VM] = np.nan
2928
ppc["bus"][disco, VA] = np.nan
3029
ppc["bus"][disco, PD] = 0
@@ -142,18 +141,18 @@ def _get_bus_results_3ph(net, bus_pq):
142141

143142
def write_voltage_dependend_load_results(net, p, q, b):
144143
load_df = net["load"]
145-
_is_elements = net["_is_elements"]
146144

147145
if load_df.empty:
148146
return p, q, b
149-
147+
148+
_is_elements = net["_is_elements"]
149+
150+
# load_is = [1 if x else np.nan for x in _is_elements["load"]]
150151
load_is = _is_elements["load"]
151152
scaling = load_df["scaling"].values
152153
bus_lookup = net["_pd2ppc_lookups"]["bus"]
153154
lidx = bus_lookup[load_df["bus"].values]
154155

155-
voltage_depend_loads = net["_options"]["voltage_depend_loads"]
156-
157156
cz_p = load_df["const_z_p_percent"].values / 100.
158157
ci_p = load_df["const_i_p_percent"].values / 100.
159158
cp = 1. - (cz_p + ci_p)
@@ -173,20 +172,19 @@ def write_voltage_dependend_load_results(net, p, q, b):
173172

174173
b = np.hstack([b, load_df["bus"].values])
175174

176-
if voltage_depend_loads:
177-
# constant impedance and constant current
178-
vm_l = net["_ppc"]["bus"][lidx, 7]
179-
volt_depend_p = ci_p * vm_l + cz_p * vm_l ** 2
180-
pl = load_df["p_mw"].values * scaling * load_is * volt_depend_p
181-
net["res_load"]["p_mw"] += pl
182-
p = np.hstack([p, pl])
175+
# constant impedance and constant current
176+
vm_l = net["_ppc"]["bus"][lidx, 7]
177+
volt_depend_p = ci_p * vm_l + cz_p * vm_l ** 2
178+
pl = load_df["p_mw"].values * scaling * load_is * volt_depend_p
179+
net["res_load"]["p_mw"] += pl
180+
p = np.hstack([p, pl])
183181

184-
volt_depend_q = ci_q * vm_l + cz_q * vm_l ** 2
185-
ql = load_df["q_mvar"].values * scaling * load_is * volt_depend_q #* volt_depend
186-
net["res_load"]["q_mvar"] += ql
187-
q = np.hstack([q, ql])
182+
volt_depend_q = ci_q * vm_l + cz_q * vm_l ** 2
183+
ql = load_df["q_mvar"].values * scaling * load_is * volt_depend_q #* volt_depend
184+
net["res_load"]["q_mvar"] += ql
185+
q = np.hstack([q, ql])
188186

189-
b = np.hstack([b, load_df["bus"].values])
187+
b = np.hstack([b, load_df["bus"].values])
190188
return p, q, b
191189

192190

@@ -197,7 +195,7 @@ def write_pq_results_to_element(
197195
"""
198196
get p_mw and q_mvar for a specific pq element ("load", "sgen"...).
199197
This function basically writes values element table to res_element table
200-
198+
201199
Parameter:
202200
net: the pandapower net
203201
ppc: a ppc DataFrame
@@ -445,7 +443,7 @@ def get_p_q_b(net, element, suffix=None):
445443

446444
def get_p_q_b_3ph(net, element):
447445
ac = net["_options"]["ac"]
448-
res_ = "res_" + element+ "_3ph"
446+
res_ = f"res_{element}_3ph"
449447

450448
# bus values are needed for stacking
451449
b = net[element]["bus"].values

pandapower/test/consistency_checks.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,19 @@ def branch_loss_consistent_with_bus_feed_in(net, atol=1e-2):
7575
bus_surplus_q = -net.res_bus.q_mvar.sum()
7676
bus_dc_surplus_p = -net.res_bus_dc.p_mw.sum()
7777

78-
branch_loss_p = (
79-
net.res_line.pl_mw.values.sum() +
80-
net.res_trafo.pl_mw.values.sum() +
81-
net.res_trafo3w.pl_mw.values.sum() +
82-
net.res_impedance.pl_mw.values.sum() +
83-
net.res_dcline.pl_mw.values.sum() +
84-
net.res_tcsc.pl_mw.values.sum()
85-
)
86-
branch_loss_q = (
87-
net.res_line.ql_mvar.values.sum() +
88-
net.res_trafo.ql_mvar.values.sum() +
89-
net.res_trafo3w.ql_mvar.values.sum() +
90-
net.res_impedance.ql_mvar.values.sum() +
91-
net.res_dcline.q_to_mvar.values.sum() +
92-
net.res_dcline.q_from_mvar.values.sum() +
93-
net.res_tcsc.ql_mvar.values.sum()
94-
)
78+
branch_loss_p = (net.res_line.pl_mw.values.sum()
79+
+ net.res_trafo.pl_mw.values.sum()
80+
+ net.res_trafo3w.pl_mw.values.sum()
81+
+ net.res_impedance.pl_mw.values.sum()
82+
+ net.res_dcline.pl_mw.values.sum()
83+
+ net.res_tcsc.pl_mw.values.sum())
84+
branch_loss_q = (net.res_line.ql_mvar.values.sum()
85+
+ net.res_trafo.ql_mvar.values.sum()
86+
+ net.res_trafo3w.ql_mvar.values.sum()
87+
+ net.res_impedance.ql_mvar.values.sum()
88+
+ net.res_dcline.q_to_mvar.values.sum()
89+
+ net.res_dcline.q_from_mvar.values.sum()
90+
+ net.res_tcsc.ql_mvar.values.sum())
9591
branch_dc_loss = net.res_line_dc.pl_mw.values.sum()
9692

9793
try:
@@ -125,6 +121,9 @@ def element_power_consistent_with_bus_power(net, rtol=1e-2, test_q=True):
125121
bus_q = pd.Series(data=0., index=net.bus.index)
126122
bus_p_dc = pd.Series(data=0., index=net.bus_dc.index)
127123

124+
bus_p[~net.bus.in_service] = np.nan
125+
bus_q[~net.bus.in_service] = np.nan
126+
128127
for idx, tab in net.ext_grid.iterrows():
129128
if tab.in_service:
130129
bus_p.at[tab.bus] -= net.res_ext_grid.p_mw.at[idx]

pandapower/test/loadflow/test_results.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ def test_trafo(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=1e-2, l_tol=1e
161161
b2 = buses[1]
162162
b3 = buses[2]
163163
# powerfactory results to check t-equivalent circuit model
164-
runpp_with_consistency_checks(net, trafo_model="t", trafo_loading="current", init="dc",
165-
calculate_voltage_angles=True, voltage_depend_loads=False)
164+
runpp_with_consistency_checks(
165+
net, trafo_model="t", trafo_loading="current", init="dc", calculate_voltage_angles=True
166+
)
166167

167168
load1 = 28.7842
168169
load2 = 0.4830
@@ -223,7 +224,7 @@ def test_trafo(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=1e-2, l_tol=1e
223224

224225
# sincal results to check pi-equivalent circuit model
225226
net.trafo.loc[trafos, "parallel"] = 1 # sincal is tested without parallel transformers
226-
runpp_with_consistency_checks(net, trafo_model="pi", trafo_loading="current", voltage_depend_loads=False)
227+
runpp_with_consistency_checks(net, trafo_model="pi", trafo_loading="current")
227228

228229
load1 = 57.637
229230
load2 = 0.483
@@ -236,7 +237,7 @@ def test_trafo(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=1e-2, l_tol=1e
236237
assert abs(net.res_bus.vm_pu.at[b2] - v2) < v_tol
237238
assert abs(net.res_bus.vm_pu.at[b3] - v3) < v_tol
238239

239-
runpp_with_consistency_checks(net, trafo_model="pi", trafo_loading="power", voltage_depend_loads=False)
240+
runpp_with_consistency_checks(net, trafo_model="pi", trafo_loading="power")
240241

241242
load1 = 52.929
242243
load2 = 0.444
@@ -263,9 +264,8 @@ def test_trafo_2_taps(v_tol=1e-6, i_tol=1e-6, s_tol=1e-2, l_tol=1e-3, va_tol=1e-
263264

264265

265266
def test_ext_grid(result_test_network, v_tol=1e-6, va_tol=1e-2, i_tol=1e-6, s_tol=5e-3, l_tol=1e-3):
266-
# FIXME: reenable voltage dependent loads
267267
net = result_test_network
268-
runpp_with_consistency_checks(net, calculate_voltage_angles=True, voltage_depend_loads=False)
268+
runpp_with_consistency_checks(net, calculate_voltage_angles=True)
269269
buses = net.bus[net.bus.zone == "test_ext_grid"]
270270
b2 = buses.index[1]
271271
ext_grids = [
@@ -396,8 +396,7 @@ def test_enforce_qlims(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=5e-3,
396396
g1 = gens[0]
397397

398398
# enforce reactive power limits
399-
# FIXME: reenable voltage dependent loads
400-
runpp_with_consistency_checks(net, enforce_q_lims=True, voltage_depend_loads=False)
399+
runpp_with_consistency_checks(net, enforce_q_lims=True)
401400

402401
# powerfactory results
403402
u2 = 1.00607194
@@ -412,7 +411,7 @@ def test_trafo3w(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=2e-2, l_tol=
412411
net = result_test_network
413412
buses = net.bus[net.bus.zone == "test_trafo3w"].index
414413
trafos = net.trafo3w[net.trafo3w.hv_bus.isin(buses)].index
415-
runpp_with_consistency_checks(net, trafo_model="pi", voltage_depend_loads=False)
414+
runpp_with_consistency_checks(net, trafo_model="pi")
416415
b2 = buses[1]
417416
b3 = buses[2]
418417
b4 = buses[3]
@@ -453,7 +452,7 @@ def test_trafo3w(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=2e-2, l_tol=
453452
assert abs((net.res_trafo3w.i_mv_ka.at[t3] - imv)) < i_tol
454453
assert abs((net.res_trafo3w.i_lv_ka.at[t3] - ilv)) < i_tol
455454

456-
runpp_with_consistency_checks(net, trafo_model="pi", trafo3w_losses='star', voltage_depend_loads=False)
455+
runpp_with_consistency_checks(net, trafo_model="pi", trafo3w_losses='star')
457456

458457
# Test results Integral:
459458
uhv = 1.01011711678
@@ -561,12 +560,11 @@ def test_trafo3w_tap_neutral_not_zero(tap_pos, tap_side, tap_step_degree):
561560

562561

563562
def test_impedance(result_test_network, v_tol=1e-6, i_tol=1e-6, s_tol=5e-3, l_tol=1e-3):
564-
# FIXME: reenable voltage dependent loads
565563
net = result_test_network
566-
runpp_with_consistency_checks(net, voltage_depend_loads=False)
564+
runpp_with_consistency_checks(net)
567565
buses = net.bus[net.bus.zone == "test_impedance"]
568566
impedances = [x for x in net.impedance.index if net.impedance.from_bus[x] in buses.index]
569-
runpp_with_consistency_checks(net, trafo_model="t", numba=True, voltage_depend_loads=False)
567+
runpp_with_consistency_checks(net, trafo_model="t", numba=True)
570568
b2 = buses.index[1]
571569
b3 = buses.index[2]
572570
imp1 = impedances[0]

pandapower/test/loadflow/test_runpp.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_runpp_init_auxiliary_buses():
178178

179179
def test_result_iter(result_test_networks):
180180
try:
181-
runpp_with_consistency_checks(result_test_networks, enforce_q_lims=True, voltage_depend_loads=False) # FIXME: test_oos_bus_with_is_element requires volateg_depend_loads False, this should be addressed.
181+
runpp_with_consistency_checks(result_test_networks, enforce_q_lims=True)
182182
except (AssertionError):
183183
raise UserWarning(f"Consistency Error after adding {result_test_networks.last_added_case}")
184184
except(LoadflowNotConverged):
@@ -337,17 +337,16 @@ def test_two_open_switches():
337337

338338
def test_oos_bus():
339339
net = pandapowerNet(name="test_oos_bus")
340-
# FIXME voltage_depend_loads=False should be removed?
341340
add_test_oos_bus_with_is_element(net)
342-
assert runpp_with_consistency_checks(net, voltage_depend_loads=False)
341+
assert runpp_with_consistency_checks(net)
343342

344343
# test for pq-node result
345344
create_shunt(net, 6, q_mvar=0.8)
346-
assert runpp_with_consistency_checks(net, voltage_depend_loads=False)
345+
assert runpp_with_consistency_checks(net)
347346

348347
# 1test for pv-node result
349348
create_gen(net, 4, p_mw=0.5)
350-
assert runpp_with_consistency_checks(net, voltage_depend_loads=False)
349+
assert runpp_with_consistency_checks(net)
351350

352351

353352
def get_isolated(net):
@@ -591,9 +590,8 @@ def test_pypower_algorithms_iter():
591590
for alg in alg_to_test:
592591
for net in result_test_network_generator(skip_test_impedance=True):
593592
try:
594-
# FIXME: remove voltage_depend_loads?
595-
runpp_with_consistency_checks(net, enforce_q_lims=True, algorithm=alg, calculate_voltage_angles="auto", voltage_depend_loads=False)
596-
runpp_with_consistency_checks(net, enforce_q_lims=False, algorithm=alg, calculate_voltage_angles="auto", voltage_depend_loads=False)
593+
runpp_with_consistency_checks(net, enforce_q_lims=True, algorithm=alg, calculate_voltage_angles="auto")
594+
runpp_with_consistency_checks(net, enforce_q_lims=False, algorithm=alg, calculate_voltage_angles="auto")
597595
except (AssertionError):
598596
raise UserWarning("Consistency Error after adding %s" % net.last_added_case)
599597
except(LoadflowNotConverged):

0 commit comments

Comments
 (0)