Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metrix-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-metrix</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>

<artifactId>powsybl-metrix-commons</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions metrix-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>powsybl-metrix</artifactId>
<groupId>com.powsybl</groupId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -77,7 +77,6 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
Expand Down
2 changes: 1 addition & 1 deletion metrix-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>powsybl-metrix</artifactId>
<groupId>com.powsybl</groupId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion metrix-mapping/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>powsybl-metrix</artifactId>
<groupId>com.powsybl</groupId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class FilteringContext {
this.identifiable = identifiable
if (identifiable instanceof Injection) {
voltageLevel = ((Injection) identifiable).terminal.voltageLevel
substation = voltageLevel.substation.get()
substation = voltageLevel.getNullableSubstation()
} else if (identifiable instanceof Switch) {
voltageLevel = ((Switch) identifiable).voltageLevel
substation = voltageLevel.substation.get()
substation = voltageLevel.getNullableSubstation()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import java.util.Optional;
import java.util.Set;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -557,4 +558,20 @@ void tagOnAbsentTimeSeries() throws IOException {
assertFalse(tags.get("test").containsKey("calculatedTagError"));

}

@Test
void substationFilteringTest() {
final String substationFilteringScript = String.join(System.lineSeparator(),
"mapToGenerators {",
" timeSeriesName 'ts'",
" filter { substation.id == 'S1' }",
"}");
TimeSeriesIndex index = RegularTimeSeriesIndex.create(Interval.parse("2015-01-01T00:00:00Z/2015-07-20T00:00:00Z"), Duration.ofDays(50));
ReadOnlyTimeSeriesStore store = new ReadOnlyTimeSeriesStoreCache(
TimeSeries.createDouble("ts", index, 1d, 2d, 3d, 4d, 5d)
);

TimeSeriesMappingConfig config = new TimeSeriesDslLoader(substationFilteringScript).load(network, parameters, store, new DataTableStore(), null, null);
assertThat(config.getGeneratorToTimeSeriesMapping()).hasSize(2);
}
}
2 changes: 1 addition & 1 deletion metrix-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<artifactId>powsybl-metrix</artifactId>
<groupId>com.powsybl</groupId>
<version>3.0.0</version>
<version>3.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<artifactId>powsybl-metrix</artifactId>
<packaging>pom</packaging>
<version>3.0.0</version>
<version>3.0.1</version>

<name>powsybl metrix</name>
<description>Multisituation loadflow and optimization module for powsybl</description>
Expand Down Expand Up @@ -65,7 +65,7 @@
../../../metrix-distribution/target/site/jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>

<assertj.version>3.27.3</assertj.version>
<assertj.version>3.27.7</assertj.version>
<autoservice.version>1.1.1</autoservice.version>
<commonscli.version>1.9.0</commonscli.version>
<commonslang3.version>3.18.0</commonslang3.version>
Expand All @@ -75,11 +75,11 @@
<jackson.version>2.19.0</jackson.version>
<jimfs.version>1.3.0</jimfs.version>
<junit-jupiter.version>5.12.2</junit-jupiter.version>
<logback.version>1.5.19</logback.version>
<logback.version>1.5.26</logback.version>
<mockito.version>5.18.0</mockito.version>
<slf4j.version>2.0.17</slf4j.version>

<powsyblcore.version>7.1.0</powsyblcore.version>
<powsyblcore.version>7.1.1</powsyblcore.version>

<!-- Parameters used to generate the javadoc for groovy and java classes.
See the pom file in powsybl-parent for more explanations. -->
Expand Down Expand Up @@ -150,6 +150,11 @@
</dependency>

<!-- Compile dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
Expand Down