-
Notifications
You must be signed in to change notification settings - Fork 12
[Improvement] Convert all supported elements' outputs with asymmetric load flow #328
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
Conversation
Signed-off-by: furqan463 <[email protected]>
Signed-off-by: furqan463 <[email protected]>
Signed-off-by: furqan463 <[email protected]>
|
One thing that needs discussion is whether we should keep shunt & ward as balanced? |
mgovers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement once again! A couple remarks
Although Pandapower itself do not provide these output tables in case of 3ph power flow and the validation tests created here would fail if pf run with pandapower, but that do not stop us from improving the pgm_io.
Fully agree (c.c. @nitbharambe ). Maybe we can exclude those output tables from the validation check rather than just "assuming" that they are correct and then having the test fail?
tests/validation/converters/test_pandapower_converter_output.py
Outdated
Show resolved
Hide resolved
tests/validation/converters/test_pandapower_converter_output.py
Outdated
Show resolved
Hide resolved
Signed-off-by: furqan463 <[email protected]>
…eing converted as sym_load Signed-off-by: furqan463 <[email protected]>
Sorry I didn't get it. |
Signed-off-by: furqan463 <[email protected]>
apologies, i may also have misunderstood you. @nitbharambe noticed that this PR may contain a breaking change (to be confirmed), as the So we need to figure out a way to add the attributes while still remaining backwards compatibility. The following needs to be thought of:
One possible solution @nitbharambe has thought of is to include a keyword argument in the I will add the do-not-merge label to keep track of this |
|
I think it'll not break anything, as PandaPowerNet is a dictionary, there's no result class, however, a file network_structure.py defines the structure of elements and result tables. However, PP is quite lenient with attributes, meaning users can add their own attributes to the tables and nothing breaks, the standard features just ignore those extra attributes however user can use those attributes when desired. similarly adding some extra result tables in PandaPowerNet dict should not cause any harm. However, if pp adds these tables in future, the names of tables would be same as used here because these names are consistent with convention of the PP, the attributes of res_tables are also aligned. Till the time pp does not include these results, the extra tables inside PandaPowerNet should not break anything, as these will be ignored. |
This attribute does not restrict additional attributes, the name of this attribute is misleading, if you look at the code, it just controls the name of attribute being created, irrespective of that attribute being defined in network_structure.py or not. ADict._allow_invalid_attributes = True, just let's you define attribute names that do not meet any one of the above criteria. |
|
However, we can define a flag to be passed to PandaPowerConverter, whether these extra tables should be included or not. and by default make it false. |
|
There's also another idea that I'm working on for my project, is to support ZIP load model for asym_load through PGM which is not implemented in PP. |
I vaguely remember pandapower had that intention probably mentioned in their documentation or videos. But I searched their documentation now and couldn't find it. Specifically this nets comparison function would give different results when runpp and runpp_pgm functions are used: https://pandapower.readthedocs.io/en/v2.13.1/toolbox.html#comparison Regarding this point:
We see that a res_load_3ph gets generated with only symmetric values for a symmetric load component for asymmetric calculation. Hence lets go with symmetric way as you suggested for both symmetric/asymmetric calculation. Note: network_structure.py seems misleading. Its only used to create new empty network (and in their cim converter). The empty res_storage_3ph structure is different from the actual res_storage_3ph which contains symmetric form of result: p_mw and q_mvar. |
and for io as well. |
Not sure about documentation. But you can test it. You can add custom attributes to your tables. |
pp.toolbox.nets_equal already returns False for many reasons. But yes there'll be an extra warning message with False result saying: However, if otherwise make two nets equal, nets_equal() will return True along with above message. That's why I say, PP is lenient with attributes. |
alright, thank you very much for the elaborate investigation and write-up. you've convinced me. @nitbharambe any open questions from your end? |
|
Okay sounds good. No more open questions from me. An observation: I see |
@mgovers @nitbharambe there are some changes staged for next release of PP which will require change is PGM-IO, as const_i_percent and const_z_percent parameters of load will not be available in next release. We can't make these changes now, but may be create an issue about it, just a heads up. |
Good find! Definitely is a breaking change on our end. Can you please make an issue? A potential solution that is also backwards compatible could be to check for the pandapower version as we've done in the past as well. |
Signed-off-by: furqan463 <[email protected]>
Done. |
mgovers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer not to do changes like this right before the weekend. Otherwise, I agree that this is good to go. Let's merge this coming Monday.
|
Happy Monday! |
dffa47b


Changes proposed in this PR include:
The pandapower converter converts some elements like "shunt", "motor" and "ward" to pgm_input_data, but when output from pgm is converted back to pandapower with asymmetric load flow, these elements are not converted back. Resulting into a mismatch between power being injected by the source vs power being consumed/lost/inject by elements. Although Pandapower itself do not provide these output tables in case of 3ph power flow and the validation tests created here would fail if pf run with pandapower, but that do not stop us from improving the pgm_io.
Checks