e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
848 stars 479 forks source link

[bug] network is built and slack boolean is True in one generator but still warning about no reference #2157

Closed AnkurArohi closed 11 months ago

AnkurArohi commented 11 months ago

Bug report checklis

Reproducible Example

use CGMES importer 
net = from_cim.from_cim(file_list=file_list)
check if the slack boolean is set True
it is set True for one generator

While debugging i saw that the ppc for gen is an empty array , this leads to the issue 

Here is the exception 
    ref, _, _ = bustypes(ppc["bus"], ppc["gen"])

https://github.com/e2nIEE/pandapower/blob/35441514656b4124b2964a8111dbc575fdcf494d/pandapower/build_gen.py#L319C8-L319C8

The problem is that ppc["gen"] is empty

Issue Description and Traceback

net.gen.loc[[30]].slack Out[4]: 30 True Name: slack, dtype: bool

But there is an exception raised that reference is not set, this is because ppc array for gen is empty although there are gens in net

Expected Behavior

power flow run

Installed Versions

os fedora

Label

mrifraunhofer commented 11 months ago

Hallo Ankur, vielen Dank für dein Feedback. Du schreibst: "net.gen.loc[[30]].slack Out[4]: 30 True Name: slack, dtype: bool

But there is an exception raised that reference is not set, this is because ppc array for gen is empty although there are gens in net" Kannst du mal bitte prüfen, ob der "gen" ggf. nicht in_service ist? In unserem Test funktioniert der pandapower Lastfluss wenn es kein "ext_grid" aber einen "gen" mit "slack=True" und "in_service=True" gibt. Gib uns bitte den Output von "net.gen.loc[[30]].in_service".

AnkurArohi commented 11 months ago

gen is in service I checked that already

AnkurArohi commented 11 months ago

Hallo Ankur, vielen Dank für dein Feedback. Du schreibst: "net.gen.loc[[30]].slack Out[4]: 30 True Name: slack, dtype: bool

But there is an exception raised that reference is not set, this is because ppc array for gen is empty although there are gens in net" Kannst du mal bitte prüfen, ob der "gen" ggf. nicht in_service ist? In unserem Test funktioniert der pandapower Lastfluss wenn es kein "ext_grid" aber einen "gen" mit "slack=True" und "in_service=True" gibt. Gib uns bitte den Output von "net.gen.loc[[30]].in_service".

Please write in english

mrifraunhofer commented 11 months ago

Hey Ankur,

can you provide us the network or any further information to reproduce the error? Currently we can't reproduce the exception...

AnkurArohi commented 11 months ago

Thanks for you help, yes I can provide you with further details in a teams call but not the network.

AnkurArohi commented 11 months ago

Hello, we were able to run the power flow without encountering this error after synchronising and updating numpy, scipy and pandas. It seems to me that there is some incompatibility/was between these 4 modules(pp,numpy,scipy and pandas) which had led to this issue.