Skip to content

Commit a906a69

Browse files
TheMaskedTurtleachour94FranckLecuyer
authored
feat: add subtract load flow balancing option (#645)
* Add `withLoadFlow` column and field to balances adjustment * Update balances_adjustment to set with_load_flow to true * Set default value for `with_load_flow` column to true in balances_adjustment * feat: add subtract load flow balancing option * Upgrade to network-modification.version 0.27.0 Signed-off-by: achour94 <[email protected]> Signed-off-by: Joris Mancini <[email protected]> Signed-off-by: Franck LECUYER <[email protected]> Co-authored-by: achour94 <[email protected]> Co-authored-by: Franck LECUYER <[email protected]>
1 parent 02719ac commit a906a69

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
<sonar.coverage.exclusions>**/migration/**/*</sonar.coverage.exclusions>
5252
<sonar.organization>gridsuite</sonar.organization>
5353
<sonar.projectKey>org.gridsuite:network-modification-server</sonar.projectKey>
54+
<!-- TODO network-modification.version remove when upgrading gridsuite dependencies -->
55+
<network-modification.version>0.27.0</network-modification.version>
56+
<powsybl-balances-adjustment.version>2.14.1</powsybl-balances-adjustment.version>
5457
</properties>
5558

5659
<build>
@@ -94,6 +97,13 @@
9497
<type>pom</type>
9598
<scope>import</scope>
9699
</dependency>
100+
101+
<dependency>
102+
<groupId>com.powsybl</groupId>
103+
<artifactId>powsybl-balances-adjustment</artifactId>
104+
<version>${powsybl-balances-adjustment.version}</version>
105+
</dependency>
106+
97107
<!-- imports -->
98108
<dependency>
99109
<groupId>org.gridsuite</groupId>
@@ -117,6 +127,7 @@
117127
<dependency>
118128
<groupId>org.gridsuite</groupId>
119129
<artifactId>gridsuite-network-modification</artifactId>
130+
<version>${network-modification.version}</version>
120131
</dependency>
121132
<dependency>
122133
<groupId>com.powsybl</groupId>

src/main/java/org/gridsuite/modification/server/entities/equipment/modification/BalancesAdjustmentEntity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.List;
2121
import java.util.UUID;
2222

23+
import static com.powsybl.balances_adjustment.balance_computation.BalanceComputationParameters.DEFAULT_SUBTRACT_LOAD_FLOW_BALANCING;
2324
import static org.gridsuite.modification.dto.BalancesAdjustmentModificationInfos.*;
2425

2526
/**
@@ -54,6 +55,9 @@ public class BalancesAdjustmentEntity extends ModificationEntity {
5455
@Column(name = "with_ratio_tap_changers")
5556
private boolean withRatioTapChangers = DEFAULT_WITH_RATIO_TAP_CHANGERS;
5657

58+
@Column(name = "subtract_load_flow_balancing")
59+
private boolean subtractLoadFlowBalancing = DEFAULT_SUBTRACT_LOAD_FLOW_BALANCING;
60+
5761
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
5862
@JoinColumn(name = "balances_adjustment_id", foreignKey = @ForeignKey(name = "area_balances_adjustment_id_fk"))
5963
private List<BalancesAdjustmentAreaEntity> areas;
@@ -78,6 +82,7 @@ public BalancesAdjustmentModificationInfos toModificationInfos() {
7882
.withLoadFlow(withLoadFlow)
7983
.loadFlowParametersId(loadFlowParametersId)
8084
.withRatioTapChangers(withRatioTapChangers)
85+
.subtractLoadFlowBalancing(subtractLoadFlowBalancing)
8186
.build();
8287
}
8388

@@ -95,6 +100,7 @@ private void assignAttributes(BalancesAdjustmentModificationInfos balancesAdjust
95100
withLoadFlow = balancesAdjustmentModificationInfos.isWithLoadFlow();
96101
loadFlowParametersId = balancesAdjustmentModificationInfos.getLoadFlowParametersId();
97102
withRatioTapChangers = balancesAdjustmentModificationInfos.isWithRatioTapChangers();
103+
subtractLoadFlowBalancing = balancesAdjustmentModificationInfos.isSubtractLoadFlowBalancing();
98104
List<BalancesAdjustmentAreaEntity> areaEntities = balancesAdjustmentModificationInfos
99105
.getAreas()
100106
.stream()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
3+
<changeSet author="mancinijor (generated)" id="1749721253189-28">
4+
<addColumn tableName="balances_adjustment">
5+
<column name="subtract_load_flow_balancing" type="boolean" defaultValue="false"/>
6+
</addColumn>
7+
</changeSet>
8+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ databaseChangeLog:
372372
- include:
373373
file: changesets/changelog_20250620T115827Z.xml
374374
relativeToChangelogFile: true
375+
- include:
376+
file: changesets/changelog_20250612T094023Z.xml
377+
relativeToChangelogFile: true
375378
- include:
376379
file: changesets/changelog_20250722T125427Z.xml
377380
relativeToChangelogFile: true

0 commit comments

Comments
 (0)