Skip to content

persist em input #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 21, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Cleaned up `IndividualTimeSeriesMetaInformation`-related methods in `CsvFileConnector` [#544](https://github.com/ie3-institute/PowerSystemDataModel/issues/544)
- Fixed spotlessApply handling for `.groovy` files [#637](https://github.com/ie3-institute/PowerSystemDataModel/issues/637)
- Re-using SQL connection per default [#653](https://github.com/ie3-institute/PowerSystemDataModel/issues/653)
- Persisting EmInputs [#665](https://github.com/ie3-institute/PowerSystemDataModel/issues/665)

### Changed
- BREAKING: PvInput Model parameter name height changed to elevationAngle [#393](https://github.com/ie3-institute/PowerSystemDataModel/issues/393) :warning:
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/edu/ie3/datamodel/io/sink/CsvFileSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public void persistJointGrid(JointGridContainer jointGridContainer) {
Set<PvInput> pvPlants = systemParticipants.getPvPlants();
Set<StorageInput> storages = systemParticipants.getStorages();
Set<WecInput> wecPlants = systemParticipants.getWecPlants();
Set<EmInput> emSystems = systemParticipants.getEmSystems();

// get graphic elements (just for better readability, we could also just get them directly
// below)
Expand Down Expand Up @@ -231,7 +232,8 @@ public void persistJointGrid(JointGridContainer jointGridContainer) {
loads,
pvPlants,
storages,
wecPlants)
wecPlants,
emSystems)
.flatMap(Collection::stream)
.map(Extractor::extractOperator)
.flatMap(Optional::stream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public SystemParticipants(Collection<SystemParticipants> systemParticipants) {
/**
* Create an instance based on a list of {@link SystemParticipantInput} entities
*
* @param systemParticipants list of system participants this container instance should created
* @param systemParticipants list of system participants this container instance should be created
* from
*/
public SystemParticipants(List<SystemParticipantInput> systemParticipants) {
Expand Down Expand Up @@ -182,6 +182,7 @@ public final List<SystemParticipantInput> allEntitiesAsList() {
allEntities.addAll(pvPlants);
allEntities.addAll(storages);
allEntities.addAll(wecPlants);
allEntities.addAll(emSystems);
return Collections.unmodifiableList(allEntities);
}

Expand All @@ -205,7 +206,7 @@ public Set<EvInput> getEvs() {
return evs;
}

/** @return unmodifiable Set of all fixed feed in in this grid */
/** @return unmodifiable Set of all fixed feed in this grid */
public Set<FixedFeedInInput> getFixedFeedIns() {
return Collections.unmodifiableSet(fixedFeedIns);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CsvSystemParticipantSourceTest extends Specification implements CsvTestDat
then:
systemParticipantsOpt.present
systemParticipantsOpt.ifPresent({ systemParticipants ->
assert (systemParticipants.allEntitiesAsList().size() == 10)
assert (systemParticipants.allEntitiesAsList().size() == 11)
assert (systemParticipants.getPvPlants().first().uuid == sptd.pvInput.uuid)
assert (systemParticipants.getBmPlants().first().uuid == sptd.bmInput.uuid)
assert (systemParticipants.getChpPlants().first().uuid == sptd.chpInput.uuid)
Expand Down