Closed mr0321 closed 5 months ago
Thanks for your issue. Before starting a PR to fix this, I have a question in order to understand how you meet this issue. The slack terminal is a terminal connected to the slack bus used by the power flow. At the end of a power flow (open loadflow in fact), the bus cannot be null. But in your case, it seems that the bus connected to the slack terminal is null: the only way is that this terminal has been disconnected. Or we have another issue. Thanks for clarifications!
Hi, thank you for your response. This is a strange case indeed. Maybe I am missing something because I am not from this field, but looking through the powsybl code I reached to same conclusion. Working as a part of a team developing a European Merging Function I tested it on the IGM's that I was able to get my hands on (from the OPDM ( ENTSO-E)). It usually occurred with a model from one specific TSO, whereas the validations, loadflow calculations, etc, didn't give any indication that something was wrong. It also happened when using models from several TSO's (merged), in this case, some particular neighbouring TSO pairs or triplets at some timestamps produced the same result (export -> NullPointer, loadflow-> nothing significant to report). Dropping one them usually solved the issue.
Thanks for these details. We are going to open a PR with your the fix that makes sense of the slack terminal has been disconnected. In the same time, can you bump to https://github.com/powsybl/pypowsybl/releases/tag/v1.4.0 and tell me if you still have the issue on a case ? If you still have, you can also put in your config file the parameter iidm.export.cgmes.export-sv-injections-for-slacks
to false.
Hi, thank you for the recommendations. I tested out and 1.4.0 indeed seems to solve the issue.
Solved by #3027
Describe the current behavior
When trying to export SV from imported model in
CGMES
formatNullPointerException
occurs. It happens either:Describe the expected behavior
Should be able to export the SV in CGMES or should be some understanding why it was not possible (e.g some thresholds were exceeded)
Describe the steps
load_from_binary_buffers
: all OKsave_to_binary_buffer
: exceptionNo other steps were done between those two
Environment
Relevant Log Output
Extra Information
One possible workaround to solve the issue would be to add additional check to the
cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/StateVariablesExport.java
in methodwriteSvInjectionsForSlacks
:Bus bus = st.getTerminal().getBusBreakerView().getBus();
->if (bus != null)
->Optional<Bus> optionalBusViewBus = BusTools.getBusViewBus(bus);