Skip to content

Potential shunt ordering bug in canos_pf.py and pf_losses_utils.py #1

@jxnscott

Description

@jxnscott

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions