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

upgrade powsybl network store v1.22.0 and add regulating point for ratio and phase tap changers #84

Merged
merged 47 commits into from
Feb 5, 2025

Conversation

EtienneLt
Copy link
Contributor

@EtienneLt EtienneLt commented Nov 27, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

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

@EtienneLt EtienneLt self-assigned this Nov 27, 2024
Copy link
Contributor

@antoinebhs antoinebhs left a 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

@EtienneLt EtienneLt force-pushed the add-regulating-point-for-transformers branch from 4ff4275 to 3b5b544 Compare December 6, 2024 12:43
EtienneLt and others added 8 commits December 9, 2024 15:26
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]>
@EtienneLt EtienneLt force-pushed the add-regulating-point-for-transformers branch from 3b5b544 to efe2df9 Compare December 10, 2024 15:26
@EtienneLt EtienneLt changed the base branch from main to move-boolean-regulating-from-equipment-to-regulatingPoint December 11, 2024 10:00

// 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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;
    }

Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as below

Copy link
Contributor

@antoinebhs antoinebhs left a 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

EtienneLt and others added 5 commits December 11, 2024 17:01
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Seddik Yengui <[email protected]>
Seddik Yengui added 3 commits December 18, 2024 22:12
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]>
@EtienneLt EtienneLt changed the base branch from move-boolean-regulating-from-equipment-to-regulatingPoint to main January 17, 2025 09:53
Signed-off-by: Etienne LESOT <[email protected]>
@EtienneLt EtienneLt requested a review from antoinebhs January 21, 2025 12:42
pom.xml Outdated Show resolved Hide resolved
Signed-off-by: Etienne LESOT <[email protected]>
pom.xml Outdated Show resolved Hide resolved
Copy link
Contributor

@antoinebhs antoinebhs left a 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

@jonenst
Copy link
Contributor

jonenst commented Jan 23, 2025

479 merged this one is needed when when bump the client version

@EtienneLt EtienneLt changed the title add regulating point for ratio and phase tap changers upgrade powsybl network store to v1.22.0 and adapt Feb 5, 2025
@EtienneLt EtienneLt changed the title upgrade powsybl network store to v1.22.0 and adapt upgrade powsybl network store v1.22.0 and add regulating point for ratio and phase tap changers Feb 5, 2025
@antoinebhs antoinebhs merged commit 0d4a843 into main Feb 5, 2025
5 checks passed
@antoinebhs antoinebhs deleted the add-regulating-point-for-transformers branch February 5, 2025 14:26
@antoinebhs antoinebhs restored the add-regulating-point-for-transformers branch February 5, 2025 15:26
@antoinebhs antoinebhs deleted the add-regulating-point-for-transformers branch February 5, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants