Skip to content

Commit 552452f

Browse files
authored
Merge pull request #370 from ie3-institute/sp/#368-read-evcs-in-CsvSystemParticipantSource
Adding evcs to CsvSystemParticipantSource.getSystemParticipants
2 parents 8da3021 + baa9be1 commit 552452f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased/Snapshot]
88

9+
### Fixed
10+
- `CsvSystemParticipantSource#getSystemParticipants()` now correctly returns electric vehicle charging station input models [PR#370](https://github.com/ie3-institute/PowerSystemDataModel/pull/370)
11+
912
## [2.0.0] - 2021-05-21
1013

1114
### Added

src/main/java/edu/ie3/datamodel/io/source/csv/CsvSystemParticipantSource.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ public Optional<SystemParticipants> getSystemParticipants() {
153153
.filter(isPresentCollectIfNot(EvInput.class, nonBuildEntities))
154154
.map(Optional::get)
155155
.collect(Collectors.toSet());
156+
Set<EvcsInput> evcs =
157+
nodeAssetEntityStream(EvcsInput.class, evcsInputFactory, nodes, operators)
158+
.filter(isPresentCollectIfNot(EvcsInput.class, nonBuildEntities))
159+
.map(Optional::get)
160+
.collect(Collectors.toSet());
156161
Set<ChpInput> chpInputs =
157162
chpInputStream(nodes, operators, chpTypes, thermalBuses, thermalStorages)
158163
.filter(isPresentCollectIfNot(ChpInput.class, nonBuildEntities))
@@ -175,7 +180,7 @@ public Optional<SystemParticipants> getSystemParticipants() {
175180
new SystemParticipants(
176181
bmInputs,
177182
chpInputs,
178-
Collections.emptySet(),
183+
evcs,
179184
evs,
180185
fixedFeedInInputs,
181186
hpInputs,

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvSystemParticipantSourceTest.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import edu.ie3.datamodel.models.input.system.WecInput
2525
import edu.ie3.datamodel.models.input.thermal.ThermalBusInput
2626
import edu.ie3.datamodel.models.input.thermal.ThermalStorageInput
2727
import edu.ie3.test.common.SystemParticipantTestData as sptd
28-
import org.apache.commons.lang3.NotImplementedException
2928
import spock.lang.Specification
3029

3130
class CsvSystemParticipantSourceTest extends Specification implements CsvTestDataMeta {
@@ -45,7 +44,7 @@ class CsvSystemParticipantSourceTest extends Specification implements CsvTestDat
4544
then:
4645
systemParticipantsOpt.present
4746
systemParticipantsOpt.ifPresent({ systemParticipants ->
48-
assert (systemParticipants.allEntitiesAsList().size() == 9)
47+
assert (systemParticipants.allEntitiesAsList().size() == 10)
4948
assert (systemParticipants.getPvPlants().first().uuid == sptd.pvInput.uuid)
5049
assert (systemParticipants.getBmPlants().first().uuid == sptd.bmInput.uuid)
5150
assert (systemParticipants.getChpPlants().first().uuid == sptd.chpInput.uuid)
@@ -55,7 +54,7 @@ class CsvSystemParticipantSourceTest extends Specification implements CsvTestDat
5554
assert (systemParticipants.getLoads().first().uuid == sptd.loadInput.uuid)
5655
assert (systemParticipants.getWecPlants().first().uuid == sptd.wecInput.uuid)
5756
assert (systemParticipants.getStorages().first().uuid == sptd.storageInput.uuid)
58-
assert (systemParticipants.getEvCS() == [] as Set)
57+
assert (systemParticipants.getEvCS().first().uuid == sptd.evcsInput.uuid)
5958
})
6059
}
6160

0 commit comments

Comments
 (0)