Skip to content

Commit 11c9e58

Browse files
authored
Merge branch 'main' into fix_custom_style_nad
2 parents 7cfb47b + 9b38f18 commit 11c9e58

105 files changed

Lines changed: 1936 additions & 60 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/fork-build-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ jobs:
2323
with:
2424
distribution: 'temurin'
2525
java-version: '21'
26+
cache: 'maven'
2627

2728
- name: Build with Maven (Ubuntu)
2829
if: matrix.os == 'ubuntu-latest'
29-
run: ./mvnw --batch-mode -P jacoco,checks install
30+
run: ./mvnw -B -ntp -Pjacoco install
3031

3132
- name: Build with Maven (Windows)
3233
if: matrix.os == 'windows-latest'
33-
run: mvnw.cmd --batch-mode install
34+
run: mvnw.cmd -B -ntp verify -Dpowsybl.checks.skip=true
3435
shell: cmd
3536

3637
- name: Build with Maven (MacOS)
3738
if: matrix.os == 'macos-latest'
38-
run: ./mvnw --batch-mode install
39+
run: ./mvnw -B -ntp verify -Dpowsybl.checks.skip=true
3940

4041
- name: Regroup dependencies in target folders
4142
if: matrix.os == 'ubuntu-latest'

.github/workflows/fork-sonar.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
with:
8383
distribution: 'temurin'
8484
java-version: '21'
85+
cache: 'maven'
8586

8687
- name: Download artifact
8788
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1

.github/workflows/maven.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,33 @@ jobs:
2424
steps:
2525
- name: Checkout sources
2626
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
with:
28+
fetch-depth: 0
2729

2830
- name: Set up JDK 21
2931
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
3032
with:
3133
distribution: 'temurin'
32-
java-version: 21
34+
java-version: '21'
35+
cache: 'maven'
3336

3437
- name: Build with Maven (Ubuntu)
3538
if: matrix.os == 'ubuntu-latest'
36-
run: ./mvnw --batch-mode -P jacoco,checks install
39+
run: ./mvnw -B -ntp -Pjacoco install
3740

3841
- name: Build with Maven (Windows)
3942
if: matrix.os == 'windows-latest'
40-
run: mvnw.cmd --batch-mode install
43+
run: mvnw.cmd -B -ntp verify -Dpowsybl.checks.skip=true
4144
shell: cmd
4245

4346
- name: Build with Maven (MacOS)
4447
if: matrix.os == 'macos-latest'
45-
run: ./mvnw --batch-mode install
48+
run: ./mvnw -B -ntp verify -Dpowsybl.checks.skip=true
4649

4750
- name: Run SonarCloud analysis
4851
if: matrix.os == 'ubuntu-latest'
4952
run: >
50-
./mvnw --batch-mode -Pjacoco verify sonar:sonar
53+
./mvnw -B -ntp -DskipTests sonar:sonar
5154
-Dsonar.host.url=https://sonarcloud.io
5255
-Dsonar.organization=powsybl-ci-github
5356
-Dsonar.projectKey=com.powsybl:powsybl-diagram

THIRD-PARTY.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
net.jcip--jcip-annotations--1.0=Creative Commons Attribution 2.5 Generic License

THIRD-PARTY.txt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
List of third-party dependencies grouped by their license type.
3+
4+
5+
Apache License, Version 2.0
6+
7+
* Apache Commons CLI (commons-cli:commons-cli:1.9.0 - https://commons.apache.org/proper/commons-cli/)
8+
* Apache Commons Codec (commons-codec:commons-codec:1.17.1 - https://commons.apache.org/proper/commons-codec/)
9+
* Apache Commons Compress (org.apache.commons:commons-compress:1.27.1 - https://commons.apache.org/proper/commons-compress/)
10+
* Apache Commons IO (commons-io:commons-io:2.19.0 - https://commons.apache.org/proper/commons-io/)
11+
* Apache Commons Lang (org.apache.commons:commons-lang3:3.18.0 - https://commons.apache.org/proper/commons-lang/)
12+
* Apache Commons Math (org.apache.commons:commons-math3:3.6.1 - http://commons.apache.org/proper/commons-math/)
13+
* Apache Commons Text (org.apache.commons:commons-text:1.13.1 - https://commons.apache.org/proper/commons-text)
14+
* Apache ServiceMix :: Bundles :: gdata (org.apache.servicemix.bundles:org.apache.servicemix.bundles.gdata:1.47.1_1 - http://servicemix.apache.org/bundles-pom/org.apache.servicemix.bundles.gdata/)
15+
* Auto Common Libraries (com.google.auto:auto-common:1.2.1 - https://github.com/google/auto/tree/master/common)
16+
* AutoService (com.google.auto.service:auto-service-annotations:1.1.1 - https://github.com/google/auto/tree/main/service)
17+
* AutoService Processor (com.google.auto.service:auto-service:1.1.1 - https://github.com/google/auto/tree/main/service)
18+
* EJML (org.ejml:ejml-core:0.44.0 - http://ejml.org/)
19+
* error-prone annotations (com.google.errorprone:error_prone_annotations:2.36.0 - https://errorprone.info/error_prone_annotations)
20+
* FindBugs-jsr305 (com.google.code.findbugs:jsr305:3.0.2 - http://findbugs.sourceforge.net/)
21+
* graphviz-builder (org.anarres.graphviz:graphviz-builder:1.0.12 - https://github.com/shevek/graphviz4j)
22+
* Guava: Google Core Libraries for Java (com.google.guava:guava:33.4.8-jre - https://github.com/google/guava)
23+
* Guava InternalFutureFailureAccess and InternalFutures (com.google.guava:failureaccess:1.0.3 - https://github.com/google/guava/failureaccess)
24+
* Guava ListenableFuture only (com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava - https://github.com/google/guava/listenablefuture)
25+
* J2ObjC Annotations (com.google.j2objc:j2objc-annotations:3.0.0 - https://github.com/google/j2objc/)
26+
* Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.19.0 - https://github.com/FasterXML/jackson)
27+
* Jackson-core (com.fasterxml.jackson.core:jackson-core:2.19.0 - https://github.com/FasterXML/jackson-core)
28+
* jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.19.0 - https://github.com/FasterXML/jackson)
29+
* Java UUID Generator (com.fasterxml.uuid:java-uuid-generator:4.3.0 - https://github.com/cowtowncoder/java-uuid-generator)
30+
* JHeaps (org.jheaps:jheaps:0.14 - http://www.jheaps.org)
31+
* JSpecify annotations (org.jspecify:jspecify:1.0.0 - http://jspecify.org/)
32+
* MAT File Library / Core (us.hebi.matlab.mat:mfl-core:0.5.15 - https://github.com/HebiRobotics/MFL/mfl-core)
33+
* MAT File Library / EJML (us.hebi.matlab.mat:mfl-ejml:0.5.15 - https://github.com/HebiRobotics/MFL/mfl-ejml)
34+
* SIROCCO :: Text Table Formatter (org.ow2.sirocco:sirocco-text-table-formatter:1.0 - http://www.ow2.org/sirocco-text-table-formatter)
35+
* SnakeYAML (org.yaml:snakeyaml:2.4 - https://bitbucket.org/snakeyaml/snakeyaml)
36+
* univocity-parsers (com.univocity:univocity-parsers:2.9.0 - http://github.com/univocity/univocity-parsers)
37+
38+
BSD 0-clause License
39+
40+
* XZ for Java (org.tukaani:xz:1.10 - https://tukaani.org/xz/java.html)
41+
42+
BSD 2-clause License
43+
44+
* Native Library Loader (org.scijava:native-lib-loader:2.5.0 - https://github.com/scijava/native-lib-loader)
45+
* StAX Utilities Project (net.java.dev.stax-utils:stax-utils:20070216 - http://java.net/projects/stax-utils/)
46+
* zstd-jni (com.github.luben:zstd-jni:1.5.7-3 - https://github.com/luben/zstd-jni)
47+
48+
BSD 3-clause License
49+
50+
* ANTLR 3 Runtime (org.antlr:antlr-runtime:3.5.3 - http://www.antlr.org)
51+
* StringTemplate 4 (org.antlr:ST4:4.3.4 - http://nexus.sonatype.org/oss-repository-hosting.html/ST4)
52+
53+
Creative Commons Attribution 2.5 Generic License
54+
55+
* "Java Concurrency in Practice" book annotations (net.jcip:jcip-annotations:1.0 - http://jcip.net/)
56+
57+
Eclipse Public License - v 1.0, GNU Lesser General Public License v2.1
58+
59+
* Logback Core Module (ch.qos.logback:logback-core:1.5.19 - http://logback.qos.ch/logback-core)
60+
61+
Eclipse Public License - v 2.0, GNU Lesser General Public License v2.1
62+
63+
* JGraphT - Core (org.jgrapht:jgrapht-core:1.5.2 - http://www.jgrapht.org/jgrapht-core)
64+
65+
GNU Lesser General Public License v2.1
66+
67+
* FindBugs-Annotations (com.google.code.findbugs:annotations:3.0.1 - http://findbugs.sourceforge.net/)
68+
* GNU Trove (net.sf.trove4j:trove4j:3.0.3 - http://trove4j.sf.net)
69+
70+
Go License
71+
72+
* RE2/J (com.google.re2j:re2j:1.8 - http://github.com/google/re2j)
73+
74+
MIT License
75+
76+
* apfloat (org.apfloat:apfloat:1.10.1 - http://www.apfloat.org)
77+
* SLF4J API Module (org.slf4j:slf4j-api:2.0.17 - http://www.slf4j.org)
78+
79+
Public Domain
80+
81+
* JAMA (gov.nist.math:jama:1.0.3 - http://math.nist.gov/javanumerics/jama/)

diagram-util/src/main/java/com/powsybl/diagram/util/layout/algorithms/Atlas2ForceLayoutAlgorithm.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public class Atlas2ForceLayoutAlgorithm<V, E> implements LayoutAlgorithm<V, E> {
6565
public Atlas2ForceLayoutAlgorithm(Atlas2Parameters layoutParameters) {
6666
this.forces.add(new RepulsionForceDegreeBasedLinear<>(
6767
layoutParameters.getRepulsionIntensity(),
68-
layoutParameters.isRepulsionFromFixedPointsEnabled()));
68+
true
69+
));
6970
this.forces.add(new EdgeAttractionForceLinear<>(layoutParameters.getEdgeAttractionIntensity()));
7071
if (layoutParameters.isAttractToCenterEnabled()) {
7172
// Atlas2 talks about both a unit gravity force and a linear gravity force

diagram-util/src/main/java/com/powsybl/diagram/util/layout/algorithms/parameters/Atlas2Parameters.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public final class Atlas2Parameters {
1919
private static final double DEFAULT_MAX_SPEED_FACTOR = 10;
2020
private static final double DEFAULT_SWING_TOLERANCE = 1;
2121
private static final double DEFAULT_MAX_GLOBAL_SPEED_INCREASE_RATIO = 1.5;
22-
private static final boolean DEFAULT_REPULSION_FROM_FIXED_POINTS_ENABLED = true;
2322
private static final boolean DEFAULT_ATTRACT_TO_CENTER_ENABLED = true;
2423

2524
private final int maxSteps;
@@ -30,7 +29,6 @@ public final class Atlas2Parameters {
3029
private final double maxSpeedFactor;
3130
private final double swingTolerance;
3231
private final double maxGlobalSpeedIncreaseRatio;
33-
private final boolean repulsionFromFixedPointsEnabled;
3432
private final boolean attractToCenterEnabled;
3533

3634
private Atlas2Parameters(
@@ -42,7 +40,6 @@ private Atlas2Parameters(
4240
double maxSpeedFactor,
4341
double swingTolerance,
4442
double maxGlobalSpeedIncreaseRatio,
45-
boolean repulsionFromFixedPointsEnabled,
4643
boolean attractToCenterEnabled
4744
) {
4845
this.maxSteps = maxSteps;
@@ -53,7 +50,6 @@ private Atlas2Parameters(
5350
this.maxSpeedFactor = maxSpeedFactor;
5451
this.swingTolerance = swingTolerance;
5552
this.maxGlobalSpeedIncreaseRatio = maxGlobalSpeedIncreaseRatio;
56-
this.repulsionFromFixedPointsEnabled = repulsionFromFixedPointsEnabled;
5753
this.attractToCenterEnabled = attractToCenterEnabled;
5854
}
5955

@@ -66,7 +62,6 @@ public static class Builder {
6662
private double maxSpeedFactor = DEFAULT_MAX_SPEED_FACTOR;
6763
private double swingTolerance = DEFAULT_SWING_TOLERANCE;
6864
private double maxGlobalSpeedIncreaseRatio = DEFAULT_MAX_GLOBAL_SPEED_INCREASE_RATIO;
69-
private boolean repulsionFromFixedPointsEnabled = DEFAULT_REPULSION_FROM_FIXED_POINTS_ENABLED;
7065
private boolean attractToCenterEnabled = DEFAULT_ATTRACT_TO_CENTER_ENABLED;
7166

7267
/**
@@ -164,17 +159,6 @@ public Builder withMaxGlobalSpeedIncreaseRatio(double maxGlobalSpeedIncreaseRati
164159
return this;
165160
}
166161

167-
/**
168-
* If set to true, other points will get a repulsion effect from unmovable points (fixed points),
169-
* default is {@value DEFAULT_REPULSION_FROM_FIXED_POINTS_ENABLED}
170-
* @param repulsionFromFixedPointsEnabled whether you want to activate repulsion from fixed points or not
171-
* @return the instance of this Builder with the `repulsionFromFixedPointsEnabled` changed
172-
*/
173-
public Builder withRepulsionFromFixedPointsEnabled(boolean repulsionFromFixedPointsEnabled) {
174-
this.repulsionFromFixedPointsEnabled = repulsionFromFixedPointsEnabled;
175-
return this;
176-
}
177-
178162
/**
179163
* Activate or deactivate the force that attracts points to the center of the graph. It is used to prevent non-connected points
180164
* from drifting away, default is {@value DEFAULT_ATTRACT_TO_CENTER_ENABLED}
@@ -196,7 +180,6 @@ public Atlas2Parameters build() {
196180
maxSpeedFactor,
197181
swingTolerance,
198182
maxGlobalSpeedIncreaseRatio,
199-
repulsionFromFixedPointsEnabled,
200183
attractToCenterEnabled
201184
);
202185
}
@@ -234,10 +217,6 @@ public double getMaxGlobalSpeedIncreaseRatio() {
234217
return maxGlobalSpeedIncreaseRatio;
235218
}
236219

237-
public boolean isRepulsionFromFixedPointsEnabled() {
238-
return repulsionFromFixedPointsEnabled;
239-
}
240-
241220
public boolean isAttractToCenterEnabled() {
242221
return attractToCenterEnabled;
243222
}

diagram-util/src/test/java/com/powsybl/diagram/util/layout/algorithms/parameters/Atlas2ParametersTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Atlas2ParametersTest {
2424
double maxSpeedFactor = 12.45;
2525
double swingTolerance = 0.8;
2626
double maxGlobalSpeedIncreaseRatio = 1.69;
27-
boolean repulsionFromFixedPointsEnabled = false;
2827
boolean attractToCenterEnabled = false;
2928

3029
@Test
@@ -38,7 +37,6 @@ void checkBuilder() {
3837
.withMaxSpeedFactor(maxSpeedFactor)
3938
.withSwingTolerance(swingTolerance)
4039
.withMaxGlobalSpeedIncreaseRatio(maxGlobalSpeedIncreaseRatio)
41-
.withRepulsionFromFixedPointsEnabled(repulsionFromFixedPointsEnabled)
4240
.withAttractToCenterEnabled(attractToCenterEnabled)
4341
.build();
4442

@@ -50,7 +48,6 @@ void checkBuilder() {
5048
assertEquals(maxSpeedFactor, parameters.getMaxSpeedFactor());
5149
assertEquals(swingTolerance, parameters.getSwingTolerance());
5250
assertEquals(maxGlobalSpeedIncreaseRatio, parameters.getMaxGlobalSpeedIncreaseRatio());
53-
assertEquals(repulsionFromFixedPointsEnabled, parameters.isRepulsionFromFixedPointsEnabled());
5451
assertEquals(attractToCenterEnabled, parameters.isAttractToCenterEnabled());
5552
}
5653
}

docs/network_area_diagrams/layout/atlas2Parameters.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Note that once created, atlas2ForceLayout can be used on multiple different grap
3535
| $maxSpeedFactor$ | `double` | 10 | $\gt speedFactor$ |
3636
| $swingTolerance$ | `double` | 1 | $\gt$ 0 |
3737
| $maxGlobalSpeedIncreaseRatio$ | `double` | 1.5 | $\gt$ 1 |
38-
| $activateRepulsionForceFromFixedPoints$ | `boolean` | true | true / false |
3938
| $activateAttractToCenterForce$ | `boolean` | true | true / false |
4039

4140
### maxSteps
@@ -125,16 +124,6 @@ Atlas2Parameters atlas2Parameters = new Atlas2Parameters.Builder().withMaxGlobal
125124

126125
![ieee_118-maxGlobalSpeedIncreaseRatio_1.1.svg](/_static/img/nad/atlas2/ieee_118-maxGlobalSpeedIncreaseRatio_1.1.svg)
127126

128-
### activateRepulsionForceFromFixedPoints
129-
130-
If set to true, other points will get a repulsion effect from unmovable points (fixed points), otherwise fixed points do not repel other points.
131-
132-
```java
133-
Atlas2Parameters atlas2Parameters = new Atlas2Parameters.Builder().withActivateRepulsionForceFromFixedPoints(false).build();
134-
```
135-
136-
Identical to default, there are no fixed points in the ieee 118 graph
137-
138127
### activateAttractToCenterForce
139128

140129
Activate or deactivate the force that attracts points to the center of the graph. It is used to prevent non-connected points

network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/NetworkGraphBuilder.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ private void fillInjectionsMap(VoltageLevel vl, Graph graph, Map<String, List<In
104104
vl.getShuntCompensators().forEach(sc -> addInjection(graph, sc, injectionsMap));
105105
vl.getBatteries().forEach(b -> addInjection(graph, b, injectionsMap));
106106
vl.getStaticVarCompensators().forEach(svc -> addInjection(graph, svc, injectionsMap));
107+
vl.getVscConverterStations().forEach(vsc -> {
108+
if (vsc.getHvdcLine() == null) {
109+
addInjection(graph, vsc, injectionsMap);
110+
}
111+
});
112+
vl.getLccConverterStations().forEach(lcc -> {
113+
if (lcc.getHvdcLine() == null) {
114+
addInjection(graph, lcc, injectionsMap);
115+
}
116+
});
107117
}
108118

109119
private void addInjection(Graph graph, com.powsybl.iidm.network.Injection<?> inj, Map<String, List<Injection>> injectionsMap) {
@@ -129,10 +139,18 @@ private static Injection.Type getInjectionType(com.powsybl.iidm.network.Injectio
129139
case LOAD -> Injection.Type.LOAD;
130140
case SHUNT_COMPENSATOR -> getShuntCompensatorType((ShuntCompensator) inj);
131141
case STATIC_VAR_COMPENSATOR -> Injection.Type.STATIC_VAR_COMPENSATOR;
142+
case HVDC_CONVERTER_STATION -> getInjectionTypeForHvdcConverterStation((HvdcConverterStation<?>) inj);
132143
default -> throw new AssertionError("Unexpected injection type: " + inj.getType());
133144
};
134145
}
135146

147+
private static Injection.Type getInjectionTypeForHvdcConverterStation(HvdcConverterStation<?> hvdcConverterStation) {
148+
return switch (hvdcConverterStation.getHvdcType()) {
149+
case LCC -> Injection.Type.LCC;
150+
case VSC -> Injection.Type.VSC;
151+
};
152+
}
153+
136154
private static Injection.Type getShuntCompensatorType(ShuntCompensator shuntCompensator) {
137155
return IidmUtil.isCapacitor(shuntCompensator) ? Injection.Type.SHUNT_COMPENSATOR_CAPACITOR : Injection.Type.SHUNT_COMPENSATOR_INDUCTOR;
138156
}
@@ -191,7 +209,7 @@ private void visitTieLine(TieLine tieLine, DanglingLine dl, Graph graph) {
191209
private void visitHvdcConverterStation(HvdcConverterStation<?> converterStation, Graph graph) {
192210
// check if the hvdc line was not already added (at the other side of the line)
193211
HvdcLine hvdcLine = converterStation.getHvdcLine();
194-
if (graph.containsEdge(hvdcLine.getId())) {
212+
if (hvdcLine == null || graph.containsEdge(hvdcLine.getId())) {
195213
return;
196214
}
197215

0 commit comments

Comments
 (0)