Skip to content

Commit

Permalink
Removing uuid column from time series
Browse files Browse the repository at this point in the history
  • Loading branch information
staudtMarius committed Jan 26, 2024
1 parent 243fd9d commit a1143f7
Show file tree
Hide file tree
Showing 127 changed files with 2,310 additions and 3,200 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improving column name validation to only run once per source [#849](https://github.com/ie3-institute/PowerSystemDataModel/issues/849)
- Refactored and abstracted `EntitySource`s and `EntityData` creation [#969](https://github.com/ie3-institute/PowerSystemDataModel/issues/969)
- Updated contributing.md [#737](https://github.com/ie3-institute/PowerSystemDataModel/issues/737)
- Removing `uuid` as required column from input and result time series [#826](https://github.com/ie3-institute/PowerSystemDataModel/issues/826)

## [4.1.0] - 2023-11-02

Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of all kinds of connectors.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of an AC line.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of an electrical node, with no further distinction into bus bar,
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of electrical switches.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of transformers.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/transformer2w.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of two winding transformers.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/grid/transformer3w.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Representation of three winding transformers.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- ZonedDateTime
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/bm.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a biomass power plant.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/chp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a combined heat and power plant.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a cylindrical thermal storage using a fluent to store thermal energy.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/em.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of an energy management entity.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/ev.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of an electric vehicle, that is occasionally connected to the grid via an
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/evcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ This model is currently only a dummy implementation of an electric vehicle charg
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/fixedfeedin.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ model can be derived.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/flexoption.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a flexibility option.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/hp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a heat pump.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/load.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of (mainly) domestic loads.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/pv.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a photovoltaic power plant.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of an electrochemical storage
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Groups together all system participants such as PV, Storage etc.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/thermalhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ This reflects a simple shoe box with transmission losses
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/thermalsink.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a thermal sink.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/thermalstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a thermal storage.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/thermalunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a thermal unit.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
4 changes: 0 additions & 4 deletions docs/readthedocs/models/result/participant/wec.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Result of a wind turbine.
- Unit
- Remarks
* - uuid
- --
- uuid for the result entity
* - time
- --
- date and time for the produced result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import edu.ie3.datamodel.io.naming.TimeSeriesMetaInformation;
import edu.ie3.datamodel.io.naming.timeseries.ColumnScheme;
import edu.ie3.datamodel.io.naming.timeseries.IndividualTimeSeriesMetaInformation;
import edu.ie3.datamodel.models.UniqueEntity;
import edu.ie3.datamodel.models.Entity;
import edu.ie3.datamodel.models.timeseries.TimeSeries;
import edu.ie3.datamodel.models.timeseries.TimeSeriesEntry;
import edu.ie3.datamodel.models.value.Value;
Expand All @@ -37,8 +37,7 @@
public class CsvFileConnector implements DataConnector {
private static final Logger log = LoggerFactory.getLogger(CsvFileConnector.class);

private final Map<Class<? extends UniqueEntity>, BufferedCsvWriter> entityWriters =
new HashMap<>();
private final Map<Class<? extends Entity>, BufferedCsvWriter> entityWriters = new HashMap<>();
private final Map<UUID, BufferedCsvWriter> timeSeriesWriters = new HashMap<>();

private final FileNamingStrategy fileNamingStrategy;
Expand All @@ -52,7 +51,7 @@ public CsvFileConnector(Path baseDirectory, FileNamingStrategy fileNamingStrateg
}

public synchronized BufferedCsvWriter getOrInitWriter(
Class<? extends UniqueEntity> clz, String[] headerElements, String csvSep)
Class<? extends Entity> clz, String[] headerElements, String csvSep)
throws ConnectorException {
/* Try to the the right writer */
BufferedCsvWriter predefinedWriter = entityWriters.get(clz);
Expand Down Expand Up @@ -146,8 +145,7 @@ public synchronized void closeTimeSeriesWriter(UUID uuid) throws IOException {
* @param <C> Type of class
* @throws IOException If closing of writer fails.
*/
public synchronized <C extends UniqueEntity> void closeEntityWriter(Class<C> clz)
throws IOException {
public synchronized <C extends Entity> void closeEntityWriter(Class<C> clz) throws IOException {
Optional<BufferedCsvWriter> maybeWriter = Optional.ofNullable(entityWriters.get(clz));
if (maybeWriter.isPresent()) {
log.debug("Remove reference to entity writer for class '{}'.", clz);
Expand All @@ -166,7 +164,7 @@ public synchronized <C extends UniqueEntity> void closeEntityWriter(Class<C> clz
* @return the reader that contains information about the file to be read in
* @throws FileNotFoundException If the matching file cannot be found
*/
public BufferedReader initReader(Class<? extends UniqueEntity> clz)
public BufferedReader initReader(Class<? extends Entity> clz)
throws FileNotFoundException, ConnectorException {
Path filePath =
fileNamingStrategy
Expand Down Expand Up @@ -292,7 +290,7 @@ CsvFileDefinition buildFileDefinition(T timeSeries, String[] headLineElements, S
* @throws ConnectorException If the definition cannot be determined
*/
private CsvFileDefinition buildFileDefinition(
Class<? extends UniqueEntity> clz, String[] headLineElements, String csvSep)
Class<? extends Entity> clz, String[] headLineElements, String csvSep)
throws ConnectorException {
Path directoryPath = fileNamingStrategy.getDirectoryPath(clz).orElse(Path.of(""));
String fileName =
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/edu/ie3/datamodel/io/factory/EntityData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import edu.ie3.datamodel.exceptions.FactoryException;
import edu.ie3.datamodel.exceptions.VoltageLevelException;
import edu.ie3.datamodel.models.UniqueEntity;
import edu.ie3.datamodel.models.Entity;
import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils;
import edu.ie3.datamodel.models.voltagelevels.VoltageLevel;
import java.util.*;
Expand Down Expand Up @@ -41,8 +41,7 @@ public class EntityData extends FactoryData {
* @param fieldsToAttributes attribute map: field name to value
* @param entityClass class of the entity to be created with this data
*/
public EntityData(
Map<String, String> fieldsToAttributes, Class<? extends UniqueEntity> entityClass) {
public EntityData(Map<String, String> fieldsToAttributes, Class<? extends Entity> entityClass) {
super(fieldsToAttributes, entityClass);
}

Expand All @@ -57,8 +56,8 @@ protected EntityData(FactoryData factoryData) {

@Override
@SuppressWarnings("unchecked cast")
public Class<? extends UniqueEntity> getTargetClass() {
return (Class<? extends UniqueEntity>) super.getTargetClass();
public Class<? extends Entity> getTargetClass() {
return (Class<? extends Entity>) super.getTargetClass();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/ie3/datamodel/io/factory/EntityFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
package edu.ie3.datamodel.io.factory;

import edu.ie3.datamodel.models.UniqueEntity;
import edu.ie3.datamodel.models.Entity;

/**
* Universal factory class for creating entities with {@link EntityData} data objects.
Expand All @@ -16,7 +16,7 @@
* @version 0.1
* @since 28.01.20
*/
public abstract class EntityFactory<T extends UniqueEntity, D extends EntityData>
public abstract class EntityFactory<T extends Entity, D extends EntityData>
extends Factory<T, D, T> {
/**
* Constructor for an EntityFactory for given classes
Expand Down
Loading

0 comments on commit a1143f7

Please sign in to comment.