Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing checkValidity in MergedBus#getFictitiousP0 #3251

Open
jonenst opened this issue Dec 10, 2024 · 0 comments
Open

missing checkValidity in MergedBus#getFictitiousP0 #3251

jonenst opened this issue Dec 10, 2024 · 0 comments

Comments

@jonenst
Copy link
Contributor

jonenst commented Dec 10, 2024

Describe the current behavior

in nodebreakertopology, when you toggle a switch which invalidates a view, getting the fictitiousP0 and fictitiousQ0 throws an exception:

        Bus bus = vl.getBusView().getMergedBus(id);
        nodebreakerbusviewbus.setFictitiousP0(2.0);
        
        System.out.println(nodebreakerbusviewbus.getFictitiousP0());
        sw.setOpen(true);
        System.out.println(nodebreakerbusviewbus.getFictitiousP0());
2.0
Exception in thread "main" com.powsybl.commons.PowsyblException: Bus has been invalidated
	at com.powsybl.iidm.network.impl.CalculatedBusImpl.checkValidity(CalculatedBusImpl.java:59)
	at com.powsybl.iidm.network.impl.CalculatedBusImpl.getFictitiousP0(CalculatedBusImpl.java:148)

in busbreaker for the exact same code it returns , it returns 0:

2.0
0.0

Describe the expected behavior

it should throw. the buses set is empty and valid is false. It should behave like the nodebreakertopology. All other methods call checkValidity()

Describe the steps

No response

Environment

No response

Relevant Log Output

No response

Extra Information

https://github.com/powsybl/powsybl-core/blob/main/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/MergedBus.java#L134
https://github.com/powsybl/powsybl-core/blob/main/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/MergedBus.java#L154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: TODO
Development

No branches or pull requests

2 participants