Skip to content

Commit edc3c36

Browse files
committed
Merge branch 'dev' into ms/#1280-enhance-value-retrieval-in-TimeSeriesSource
# Conflicts: # CHANGELOG.md
2 parents dc84fcf + 4fb7159 commit edc3c36

File tree

7 files changed

+61
-8
lines changed

7 files changed

+61
-8
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reviewers for Dependabot PRs
2+
build.gradle @sebastian-peter @danielfeismann @staudtMarius
3+
4+
# Reviewers for CI/CD related PRs
5+
.github/workflows/ @sebastian-peter @PhilippSchmelter

.github/dependabot.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ updates:
77
time: "04:00"
88
open-pull-requests-limit: 10
99
target-branch: dev
10-
reviewers:
11-
- t-ober
12-
- staudtMarius
13-
- sebastian-peter
14-
- danielfeismann
15-
- jo-bao
1610

1711
- package-ecosystem: pip
1812
directory: "/docs/readthedocs"

.github/workflows/dependabot-auto-merge.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ jobs:
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"
1818

19+
- name: Check Snapshot
20+
if: contains(steps.metadata.outputs.new-version, 'snap')
21+
run: |
22+
echo "::error::Snapshot versions are not allowed – workflow stopped."
23+
exit 1
24+
25+
- name: Approve the PR
26+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
27+
run: gh pr review --approve "$PR_URL"
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
31+
1932
- name: Enable auto-merge for Dependabot PRs
2033
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
2134
run: gh pr merge --auto --merge "$PR_URL"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- Enhancing value retrieval in `TimeSeriesSource` [1280](https://github.com/ie3-institute/PowerSystemDataModel/issues/1280)
1111

12+
### Fixed
13+
- Fixed handling of `CongestionResult.InputModelType` in `EntityProcessor` [#1325](https://github.com/ie3-institute/PowerSystemDataModel/issues/1325)
14+
15+
### Changed
16+
- Updated dependabot workflow and added CODEOWNERS [#1328](https://github.com/ie3-institute/PowerSystemDataModel/issues/1328)
17+
1218
## [7.0.0] - 2025-05-08
1319

1420
### Added

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ plugins {
55
id 'signing'
66
id 'pmd' // code check, working on source code
77
id 'com.diffplug.spotless' version '7.0.3' //code format
8-
id 'com.github.spotbugs' version '6.1.11' // code check, working on byte code
8+
id 'com.github.spotbugs' version '6.1.12' // code check, working on byte code
99
id 'de.undercouch.download' version '5.6.0'
1010
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
1111
id 'jacoco' // java code coverage plugin
12-
id "org.sonarqube" version "6.1.0.5360" // sonarqube
12+
id "org.sonarqube" version "6.2.0.5505" // sonarqube
1313
id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning
1414
id "com.github.johnrengelman.shadow" version "8.1.1" // fat jar
1515
}

src/main/java/edu/ie3/datamodel/io/processor/Processor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import edu.ie3.datamodel.models.input.connector.SwitchInput;
1616
import edu.ie3.datamodel.models.input.system.characteristic.CharacteristicInput;
1717
import edu.ie3.datamodel.models.profile.LoadProfile;
18+
import edu.ie3.datamodel.models.result.CongestionResult;
1819
import edu.ie3.datamodel.models.voltagelevels.VoltageLevel;
1920
import edu.ie3.datamodel.utils.Try;
2021
import edu.ie3.datamodel.utils.Try.*;
@@ -293,6 +294,8 @@ protected String processMethodResult(Object methodReturnObject, Method method, S
293294
"ReactivePowerCharacteristic",
294295
"CharacteristicInput" -> resultStringBuilder.append(
295296
((CharacteristicInput<?, ?>) methodReturnObject).serialize());
297+
case "InputModelType" -> resultStringBuilder.append(
298+
((CongestionResult.InputModelType) methodReturnObject).type);
296299
default -> throw new EntityProcessorException(
297300
"Unable to process value for attribute/field '"
298301
+ fieldName

src/test/groovy/edu/ie3/datamodel/io/processor/result/ResultEntityProcessorTest.groovy

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package edu.ie3.datamodel.io.processor.result
77

88
import edu.ie3.datamodel.exceptions.EntityProcessorException
99
import edu.ie3.datamodel.models.StandardUnits
10+
import edu.ie3.datamodel.models.result.CongestionResult
1011
import edu.ie3.datamodel.models.result.NodeResult
1112
import edu.ie3.datamodel.models.result.ResultEntity
1213
import edu.ie3.datamodel.models.result.connector.LineResult
@@ -277,6 +278,37 @@ class ResultEntityProcessorTest extends Specification {
277278
validProcessedElement == expectedResults
278279
}
279280

281+
def "A ResultEntityProcessor should serialize a CongestionResult correctly"() {
282+
given:
283+
def resultProcessor = new ResultEntityProcessor(CongestionResult)
284+
285+
def validResult = new CongestionResult(
286+
ZonedDateTime.parse("2020-01-30T17:26:44Z"),
287+
inputModel,
288+
CongestionResult.InputModelType.LINE,
289+
3,
290+
Quantities.getQuantity(110, Units.PERCENT),
291+
Quantities.getQuantity(0, Units.PERCENT),
292+
Quantities.getQuantity(100, Units.PERCENT),
293+
)
294+
295+
def expectedResults = [
296+
inputModel: '22bea5fc-2cb2-4c61-beb9-b476e0107f52',
297+
max : '100.0',
298+
min : '0.0',
299+
subgrid : '3',
300+
time : '2020-01-30T17:26:44Z',
301+
type : 'line',
302+
value : '110.0'
303+
]
304+
305+
when:
306+
def validProcessedElement = resultProcessor.handleEntity(validResult)
307+
308+
then:
309+
validProcessedElement == expectedResults
310+
}
311+
280312
def "A ResultEntityProcessor should throw an EntityProcessorException when it receives an entity result that is not eligible"() {
281313

282314
given:

0 commit comments

Comments
 (0)