Skip to content

Commit

Permalink
WIP some bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rbolgaryn committed Nov 14, 2023
1 parent b17933a commit 7544a20
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def _check_connectivity(ppc):
bus_dc_not_reachable[reachable_dc] = False
isolated_nodes_dc, pus_dc, qus_dc, ppc = _set_isolated_nodes_out_of_service(ppc, bus_dc_not_reachable, dc=True)
else:
isolated_nodes_dc, pus_dc, qus_dc = np.array([]), 0, 0
isolated_nodes_dc, pus_dc, qus_dc = np.array([], dtype=np.int64), 0, 0

return isolated_nodes, pus, qus, isolated_nodes_dc, pus_dc, qus_dc

Expand Down
2 changes: 1 addition & 1 deletion pandapower/converter/powerfactory/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def _validate_pf_conversion_balanced(net, in_both, all_diffs):
bus_dc_diff = net.res_bus_dc.loc[bus_dc_idx].pf_vm_pu - net.res_bus_dc.loc[
bus_dc_idx].vm_pu
bus_dc_id = abs(bus_dc_diff).abs().idxmax().astype('int64')
logger.info("Maximum bus_dc vm_pu difference between pandapower and powerfactory: %.1f "
logger.info("Maximum bus_dc vm_pu difference between pandapower and powerfactory: %.6f "
"p.u. at bus_dc %d (%s)" % (
max(abs(bus_dc_diff)), bus_dc_id, net.bus_dc.at[bus_dc_id, 'name']))
all_diffs["bus_dc_diff"] = bus_dc_diff
Expand Down
1 change: 1 addition & 0 deletions pandapower/pd2ppc.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def _pd2ppc(net, sequence=None):
# sets islands (multiple isolated nodes) out of service
if "opf" in mode:
net["_isolated_buses"], _, _ = aux._check_connectivity_opf(ppc)
net["_isolated_buses_dc"] = np.array([], dtype=np.int64)
else:
net["_isolated_buses"], _, _, net["_isolated_buses_dc"], _, _ = aux._check_connectivity(ppc)
net["_is_elements_final"] = aux._select_is_elements_numba(net, net._isolated_buses,
Expand Down
2 changes: 1 addition & 1 deletion pandapower/plotting/powerflow_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def plot_voltage_profile(net, ax=None, plot_transformers=True, xlabel="Distance
if ax is None:
plt.figure(facecolor="white", dpi=120)
ax = plt.gca()
if not net.converged:
if not net.converged and not net.OPF_converged:
raise ValueError("no results in this pandapower network")
if lines is None:
lines = net.line.index
Expand Down

0 comments on commit 7544a20

Please sign in to comment.