Hi — I noticed a potential inconsistency in how PFDelta bus shunts are stored vs later converted into complex values.
In core/datasets/pfdelta_dataset.py, bus shunts are aggregated and stored as [gs, bs]:
Several PF-side equations then also assume that ordering:
However, these two spots reconstruct the complex shunt term as bus_shunts[:, 1] + 1j * bus_shunts[:, 0]:
with the comment # (b_shunt + j*g_shunt).
If data["bus"].shunt is indeed [gs, bs], this looks swapped relative to the rest of the codebase and to the usual admittance convention Y = G + jB.
At minimum, it seems inconsistent with the PFDelta dataset ordering and the other PF-side uses of data["bus"].shunt. I would expect something closer to either:
gs + 1j*bs if this is meant to be an admittance, or
gs - 1j*bs if this is meant to be the shunt complex power contribution in the power balance.
Was the current bs + 1j*gs form intentional?
Hi — I noticed a potential inconsistency in how PFDelta bus shunts are stored vs later converted into complex values.
In
core/datasets/pfdelta_dataset.py, bus shunts are aggregated and stored as[gs, bs]:Several PF-side equations then also assume that ordering:
shunt_g = data["bus"].shunt[:, 0]shunt_b = data["bus"].shunt[:, 1]delta_P = ... - V^2 * shunt_gdelta_Q = ... + V^2 * shunt_bHowever, these two spots reconstruct the complex shunt term as
bus_shunts[:, 1] + 1j * bus_shunts[:, 0]:with the comment
# (b_shunt + j*g_shunt).If
data["bus"].shuntis indeed[gs, bs], this looks swapped relative to the rest of the codebase and to the usual admittance conventionY = G + jB.At minimum, it seems inconsistent with the PFDelta dataset ordering and the other PF-side uses of
data["bus"].shunt. I would expect something closer to either:gs + 1j*bsif this is meant to be an admittance, orgs - 1j*bsif this is meant to be the shunt complex power contribution in the power balance.Was the current
bs + 1j*gsform intentional?