-
Notifications
You must be signed in to change notification settings - Fork 1
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
upgrade powsybl network store v1.22.0 and add regulating point for ratio and phase tap changers #84
Conversation
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.
Some first comments, not tested yet
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241126T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241126T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241126T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241126T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241126T110000Z.sql
Outdated
Show resolved
Hide resolved
Signed-off-by: Etienne LESOT <[email protected]>
4ff4275
to
3b5b544
Compare
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
3b5b544
to
efe2df9
Compare
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
...ork-store-server/src/main/java/com/powsybl/network/store/server/dto/RegulatingOwnerInfo.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
|
||
// three windings transformers | ||
private void setRegulatingPointForThreeWindingsTransformers(List<Resource<ThreeWindingsTransformerAttributes>> threeWindingTransformers, UUID networkUuid, int variantNum) { | ||
Map<RegulatingOwnerInfo, RegulatingPointAttributes> twtRegulatingPointAttributes = getRegulatingPoints(networkUuid, variantNum, ResourceType.THREE_WINDINGS_TRANSFORMER); |
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.
why no regulating equipments as 3wt?
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.
this is in another function,
public List<Resource<ThreeWindingsTransformerAttributes>> getThreeWindingsTransformers(UUID networkUuid, int variantNum) {
List<Resource<ThreeWindingsTransformerAttributes>> threeWindingsTransformers = getIdentifiables(networkUuid, variantNum, mappings.getThreeWindingsTransformerMappings());
Map<OwnerInfo, LimitsInfos> limitsInfos = getLimitsInfos(networkUuid, variantNum, EQUIPMENT_TYPE_COLUMN, ResourceType.THREE_WINDINGS_TRANSFORMER.toString());
insertLimitsInEquipments(networkUuid, threeWindingsTransformers, limitsInfos);
Map<OwnerInfo, List<TapChangerStepAttributes>> tapChangerSteps = getTapChangerSteps(networkUuid, variantNum, EQUIPMENT_TYPE_COLUMN, ResourceType.THREE_WINDINGS_TRANSFORMER.toString());
insertTapChangerStepsInEquipments(networkUuid, threeWindingsTransformers, tapChangerSteps);
setRegulatingPointForThreeWindingsTransformers(threeWindingsTransformers, networkUuid, variantNum);
setRegulatingEquipments(threeWindingsTransformers, networkUuid, variantNum, ResourceType.THREE_WINDINGS_TRANSFORMER);
return threeWindingsTransformers;
}
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.
Why two methods for 2wt and one for 3wt?
|
||
private void setRegulatingPointForThreeWindingsTransformersWithIds(List<Resource<ThreeWindingsTransformerAttributes>> threeWindingTransformers, UUID networkUuid, int variantNum) { | ||
List<String> elementIds = threeWindingTransformers.stream().map(Resource::getId).toList(); | ||
Map<RegulatingOwnerInfo, RegulatingPointAttributes> twtRegulatingPointAttributes = getRegulatingPointsWithInClause(networkUuid, variantNum, |
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.
why no regulating equipments as 3wt?
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.
same as below
network-store-server/src/main/java/com/powsybl/network/store/server/QueryCatalog.java
Outdated
Show resolved
Hide resolved
...-store-server/src/test/java/com/powsybl/network/store/server/NetworkStoreRepositoryTest.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/resources/db/changelog/changesets/changelog_20241205T110000Z.xml
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241205T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241205T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241205T110000Z.sql
Outdated
Show resolved
Hide resolved
...e-server/src/main/resources/db/changelog/changesets/twt_regulationPoint_20241205T110000Z.sql
Outdated
Show resolved
Hide resolved
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.
error at first start of network-store-server
grid-network-store-server-1 | Caused by: liquibase.exception.DatabaseException: ERROR: more than one row returned by a subquery used as an expression [Failed SQL: (0) UPDATE regulatingpoint r1
grid-network-store-server-1 | SET regulatedequipmenttype = (select CASE
grid-network-store-server-1 | WHEN bat.id IS NOT NULL THEN 'BATTERY'
grid-network-store-server-1 | WHEN bbs.id IS NOT NULL THEN 'BUSBAR_SECTION'
grid-network-store-server-1 | WHEN ld.id IS NOT NULL THEN 'LOAD'
grid-network-store-server-1 | WHEN gen.id IS NOT NULL THEN 'GENERATOR'
grid-network-store-server-1 | WHEN sc.id IS NOT NULL THEN 'SHUNT_COMPENSATOR'
grid-network-store-server-1 | WHEN vsc.id IS NOT NULL THEN 'VSC_CONVERTER_STATION'
grid-network-store-server-1 | WHEN lcc.id IS NOT NULL THEN 'LCC_CONVERTER_STATION'
grid-network-store-server-1 | WHEN svc.id IS NOT NULL THEN 'STATIC_VAR_COMPENSATOR'
grid-network-store-server-1 | WHEN twt.id IS NOT NULL THEN 'TWO_WINDINGS_TRANSFORMER'
grid-network-store-server-1 | WHEN ttwt.id IS NOT NULL THEN 'THREE_WINDINGS_TRANSFORMER'
grid-network-store-server-1 | WHEN l.id IS NOT NULL THEN 'LINE'
grid-network-store-server-1 | WHEN hvdc.id IS NOT NULL THEN 'HVDC_LINE'
grid-network-store-server-1 | WHEN dl.id IS NOT NULL THEN 'DANGLING_LINE'
grid-network-store-server-1 | END
grid-network-store-server-1 | FROM regulatingpoint r LEFT JOIN battery bat ON r.regulatingterminalconnectableid = bat.id and r.networkuuid = bat.networkuuid and r.variantnum = bat.variantnum
grid-network-store-server-1 | LEFT JOIN busbarsection bbs ON r.regulatingterminalconnectableid = bbs.id and r.networkuuid = bbs.networkuuid and r.variantnum = bbs.variantnum
grid-network-store-server-1 | LEFT JOIN load ld ON r.regulatingterminalconnectableid = ld.id and r.networkuuid = ld.networkuuid and r.variantnum = ld.variantnum
grid-network-store-server-1 | LEFT JOIN generator gen ON r.regulatingterminalconnectableid = gen.id and r.networkuuid = gen.networkuuid and r.variantnum = gen.variantnum
grid-network-store-server-1 | LEFT JOIN shuntcompensator sc ON r.regulatingterminalconnectableid = sc.id and r.networkuuid = sc.networkuuid and r.variantnum = sc.variantnum
grid-network-store-server-1 | LEFT JOIN vscconverterstation vsc ON r.regulatingterminalconnectableid = vsc.id and r.networkuuid = vsc.networkuuid and r.variantnum = vsc.variantnum
grid-network-store-server-1 | LEFT JOIN lccconverterstation lcc ON r.regulatingterminalconnectableid = lcc.id and r.networkuuid = lcc.networkuuid and r.variantnum = lcc.variantnum
grid-network-store-server-1 | LEFT JOIN staticvarcompensator svc ON r.regulatingterminalconnectableid = svc.id and r.networkuuid = svc.networkuuid and r.variantnum = svc.variantnum
grid-network-store-server-1 | LEFT JOIN twowindingstransformer twt ON r.regulatingterminalconnectableid = twt.id and r.networkuuid = twt.networkuuid and r.variantnum = twt.variantnum
grid-network-store-server-1 | LEFT JOIN threewindingstransformer ttwt ON r.regulatingterminalconnectableid = ttwt.id and r.networkuuid = ttwt.networkuuid and r.variantnum = ttwt.variantnum
grid-network-store-server-1 | LEFT JOIN line l ON r.regulatingterminalconnectableid = l.id and r.networkuuid = l.networkuuid and r.variantnum = l.variantnum
grid-network-store-server-1 | LEFT JOIN hvdcline hvdc ON r.regulatingterminalconnectableid = hvdc.id and r.networkuuid = hvdc.networkuuid and r.variantnum = hvdc.variantnum
grid-network-store-server-1 | LEFT JOIN danglingline dl ON r.regulatingterminalconnectableid = dl.id and r.networkuuid = dl.networkuuid and r.variantnum = dl.variantnum
grid-network-store-server-1 | WHERE r1.networkuuid = r.networkuuid and r1.variantnum = r.variantnum
grid-network-store-server-1 | and r1.regulatingequipmentid = r.regulatingequipmentid and r1.regulatingequipmenttype = r.regulatingequipmenttype)
grid-network-store-server-1 | WHERE regulatedequipmenttype is null AND r1.regulatingequipmentid <> r1.regulatingterminalconnectableid]
on my network with 1 stanway study + 2 studies with 3wt
network-store-server/src/main/resources/db/changelog/changesets/changelog_20241205T110000Z.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Seddik Yengui <[email protected]>
Signed-off-by: Seddik Yengui <[email protected]>
Signed-off-by: Franck LECUYER <[email protected]>
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
network-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Outdated
Show resolved
Hide resolved
...ork-store-server/src/main/java/com/powsybl/network/store/server/dto/RegulatingOwnerInfo.java
Show resolved
Hide resolved
Signed-off-by: Seddik Yengui <[email protected]>
Signed-off-by: Seddik Yengui <[email protected]>
Signed-off-by: Seddik Yengui <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
…2024.4.0' into add-regulating-point-for-transformers Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
network-store-server/src/main/resources/db/changelog/db.changelog-master.yaml
Outdated
Show resolved
Hide resolved
network-store-server/src/main/resources/db/changelog/changesets/changelog_20241205T110000Z.xml
Show resolved
Hide resolved
Signed-off-by: Etienne LESOT <[email protected]>
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.
Code OK
I have not tested
479 merged this one is needed when when bump the client version |
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
|
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information:
-> add regulating point for ratio and phase tap changers
-> fix test broken when upgrading network-store-version #97