Skip to content

Commit

Permalink
Merge branch 'dev' into jb/#762-sql-grid-datasources
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/edu/ie3/datamodel/io/naming/DatabaseNamingStrategy.java
  • Loading branch information
jo-bao committed Jun 14, 2024
2 parents 31da1fd + f1a1d05 commit 4243e57
Show file tree
Hide file tree
Showing 355 changed files with 6,502 additions and 6,730 deletions.
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased/Snapshot]

### Added
- Enhancing `VoltageLevel` with `equals` method [#1063](https://github.com/ie3-institute/PowerSystemDataModel/issues/1063)
- `ConnectorValidationUtils` checks if parallel devices is > 0 [#1077](https://github.com/ie3-institute/PowerSystemDataModel/issues/1077)
- `GridContainerValidationUtils` checks the connectivity for all defined operation time intervals [#1091](https://github.com/ie3-institute/PowerSystemDataModel/issues/1091)
- Implemented a `CongestionResult` [#1097](https://github.com/ie3-institute/PowerSystemDataModel/issues/1097)

### Fixed
- Fixed `MappingEntryies` not getting processed by adding `Getter` methods for record fields [#1084](https://github.com/ie3-institute/PowerSystemDataModel/issues/1084)

### Changed
- Improvements to the search for corner points in `IdCoordinateSource` [#1016](https://github.com/ie3-institute/PowerSystemDataModel/issues/1016)
- Refactor `CsvFileConnector` and `CsvDataSource` [#1007](https://github.com/ie3-institute/PowerSystemDataModel/issues/1007)


## [5.0.1] - 2024-03-07

### Fixed
- Fixed `equals` of `ResultEntity` and `TimeSeriesEntry` [#1037](https://github.com/ie3-institute/PowerSystemDataModel/issues/1037)
- Fixed "depth of discharge" in documentation [#872](https://github.com/ie3-institute/PowerSystemDataModel/issues/872)

## [5.0.0] - 2024-03-06

### Added
- Formatting Spotless Groovy import order [#960](https://github.com/ie3-institute/PowerSystemDataModel/issues/960)
- Implementing missing typical methods in `Try` [#970](https://github.com/ie3-institute/PowerSystemDataModel/issues/970)
- Added log warning when using `SwitchInputs` with `parallelDevices` parameter [#840](https://github.com/ie3-institute/PowerSystemDataModel/issues/840)
- Validation for `EvcsInput` [#1000](https://github.com/ie3-institute/PowerSystemDataModel/issues/1000)
- Scaling method in system participant copy builders [#1011](https://github.com/ie3-institute/PowerSystemDataModel/issues/1011)
- Added separate field for maximum power limit for DC to evtype [#876](https://github.com/ie3-institute/PowerSystemDataModel/issues/876)
- Added test for invalid input data in `CsvRawGridSource` [#1021](https://github.com/ie3-institute/PowerSystemDataModel/issues/1021)
- Added `CsvThermalGridSource` [#1009](https://github.com/ie3-institute/PowerSystemDataModel/issues/1009)
- Enhance documentation for CSV timeseries [#825](https://github.com/ie3-institute/PowerSystemDataModel/issues/825)

### Fixed
- Fixed Couchbase integration tests that randomly failed [#755](https://github.com/ie3-institute/PowerSystemDataModel/issues/755)
Expand All @@ -20,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed thermal-house-documentation [#873](https://github.com/ie3-institute/PowerSystemDataModel/issues/873)
- Fixed ElectricVehicle Documentation [#875](https://github.com/ie3-institute/PowerSystemDataModel/issues/875)
- Fixed Equal behavior of `ConnectorResult` [#1001](https://github.com/ie3-institute/PowerSystemDataModel/issues/1001)
- Fixed test for invalid input data in `CsvGraphicSource` [#1022](https://github.com/ie3-institute/PowerSystemDataModel/issues/1022)

### Changed
- Changing from comparing strings to comparing uuids in `EntitySource.findFirstEntityByUuid` [#829](https://github.com/ie3-institute/PowerSystemDataModel/issues/829)
Expand All @@ -35,6 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated contributing.md [#737](https://github.com/ie3-institute/PowerSystemDataModel/issues/737)
- Don't throw exceptions for not yet implemented validations [#879](https://github.com/ie3-institute/PowerSystemDataModel/issues/879)
- `CsvDataSource` throws exceptions on error [#954](https://github.com/ie3-institute/PowerSystemDataModel/issues/954)
- Removing `uuid` as required column from input and result time series [#826](https://github.com/ie3-institute/PowerSystemDataModel/issues/826)
- Removing the support for the old csv format that was marked `deprecated` back in version `1.1.0` [#795](https://github.com/ie3-institute/PowerSystemDataModel/issues/795)
- BREAKING: Updating PowerSystemUtils dependency to 2.2 [#1006](https://github.com/ie3-institute/PowerSystemDataModel/issues/1006)

## [4.1.0] - 2023-11-02

Expand Down Expand Up @@ -262,7 +292,9 @@ coordinates or multiple exactly equal coordinates possible
- CsvDataSource now stops trying to get an operator for empty operator uuid field in entities
- CsvDataSource now parsing multiple geoJson strings correctly

[Unreleased/Snapshot]: https://github.com/ie3-institute/powersystemdatamodel/compare/4.1.0...HEAD
[Unreleased/Snapshot]: https://github.com/ie3-institute/powersystemdatamodel/compare/5.0.1...HEAD
[5.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/5.0.0...5.0.1
[4.1.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/4.1.0...5.0.0
[4.1.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/4.0.0...4.1.0
[4.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/3.0.0...4.0.0
[3.0.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/2.1.0...3.0.0
Expand Down
28 changes: 14 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ plugins {
id 'signing'
id 'pmd' // code check, working on source code
id 'com.diffplug.spotless' version '6.25.0' //code format
id 'com.github.spotbugs' version '6.0.7' // code check, working on byte code
id 'de.undercouch.download' version '5.5.0'
id 'com.github.spotbugs' version '6.0.16' // code check, working on byte code
id 'de.undercouch.download' version '5.6.0'
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
id 'jacoco' // java code coverage plugin
id "org.sonarqube" version "4.4.1.3373" // sonarqube
id "org.sonarqube" version "5.0.0.4638" // sonarqube
id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning
}

ext {
//version (changing these should be considered thoroughly!)
javaVersion = JavaVersion.VERSION_17
groovyVersion = "4.0"
groovyBinaryVersion = "4.0.18"
testcontainersVersion = '1.19.5'
groovyBinaryVersion = "4.0.21"
testcontainersVersion = '1.19.8'

scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator //location of script plugins
}
Expand Down Expand Up @@ -53,7 +53,7 @@ repositories {
dependencies {

// ie³ power system utils
implementation 'com.github.ie3-institute:PowerSystemUtils:2.0'
implementation 'com.github.ie3-institute:PowerSystemUtils:2.2.1'

implementation 'tech.units:indriya:2.2'

Expand All @@ -72,8 +72,8 @@ dependencies {

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testImplementation "org.spockframework:spock-core:2.3-groovy-$groovyVersion"
testImplementation 'org.objenesis:objenesis:3.3' // Mock creation with constructor parameters
testImplementation 'net.bytebuddy:byte-buddy:1.14.12' // Mocks of classes
testImplementation 'org.objenesis:objenesis:3.4' // Mock creation with constructor parameters
testImplementation 'net.bytebuddy:byte-buddy:1.14.17' // Mocks of classes

// testcontainers (docker framework for testing)
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion"
Expand All @@ -83,19 +83,19 @@ dependencies {
testImplementation "org.testcontainers:couchbase:$testcontainersVersion"

// logging
implementation platform('org.apache.logging.log4j:log4j-bom:2.22.1')
implementation platform('org.apache.logging.log4j:log4j-bom:2.23.1')
implementation 'org.apache.logging.log4j:log4j-api' // log4j
implementation 'org.apache.logging.log4j:log4j-core' // log4j
implementation 'org.apache.logging.log4j:log4j-slf4j-impl' // log4j -> slf4j

// Databases
implementation 'org.influxdb:influxdb-java:2.24'
implementation 'com.couchbase.client:java-client:3.5.3'
runtimeOnly 'org.postgresql:postgresql:42.7.2' // postgresql jdbc driver required during runtime
implementation 'com.couchbase.client:java-client:3.6.2'
runtimeOnly 'org.postgresql:postgresql:42.7.3' // postgresql jdbc driver required during runtime

implementation 'commons-io:commons-io:2.15.1' // I/O functionalities
implementation 'org.apache.commons:commons-compress:1.25.0' // I/O functionalities
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'commons-io:commons-io:2.16.1' // I/O functionalities
implementation 'commons-codec:commons-codec:1.17.0' // needed by commons-compress
implementation 'org.apache.commons:commons-compress:1.26.2' // I/O functionalities
}

tasks.withType(JavaCompile) {
Expand Down
4 changes: 2 additions & 2 deletions docs/readthedocs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
author = 'Institute of Energy Systems, Energy Efficiency and Energy Economics'

# The full version, including alpha/beta/rc tags
version = '3.0'
release = '3.0.0'
version = '5.0'
release = '5.0.1'

pygments_style = 'tango'
add_function_parentheses = True
Expand Down
34 changes: 31 additions & 3 deletions docs/readthedocs/gettingstarted.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Getting started

Welcome, dear fellow of bottom up power system modelling!
This section is meant to give you some help getting hands on our project.
If you feel, something is missing, please contact us!
Expand All @@ -21,7 +20,7 @@ On [Maven central](https://search.maven.org/artifact/com.github.ie3-institute/Po
<dependency>
<groupId>com.github.ie3-institute</groupId>
<artifactId>PowerSystemDataModel</artifactId>
<version>2.1.0</version>
<version>5.0.1</version>
</dependency>
```

Expand All @@ -42,6 +41,35 @@ and add the dependency:
<dependency>
<groupId>com.github.ie3-institute</groupId>
<artifactId>PowerSystemDataModel</artifactId>
<version>3.0-SNAPSHOT</version>
<version>6.0-SNAPSHOT</version>
</dependency>
```

## Important changes

With the release of `PowerSystemDataModel` version `5.0` the support for the old csv file format will be fully removed.
It was already marked as `deprecated` back in version `1.1.0`. For those who are still using a model in the old csv format
the following guide will provide a fast and easy way to convert old format into the new one.

- Since the support is removed in version `5.0`, the `PowerSystemDataModel` version `3.x` or `4.x` must be
used to read the old format. The `PSDM` will automatically write the output model in the new csv format.


``` java
/* Parameterization */
String gridName = "gridWithOldFormat";
String csvSep = ",";
Path folderPath = Path.of("PATH_TO_THE_FOLDER");
boolean isHierarchic = false;
Path output = Path.of("PATH_OF_THE_OUTPUT_FOLDER");
FileNamingStrategy namingStrategy = new FileNamingStrategy();

/* Reading the old format */
JointGridContainer container = CsvJointGridContainerSource.read(gridName, csvSep, folderPath, isHierarchic);

/* Writing in the new format */
CsvFileSink sink = new CsvFileSink(output, namingStrategy, csvSep);
sink.persistJointGrid(container);
```


32 changes: 24 additions & 8 deletions docs/readthedocs/io/ValidationUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,32 @@
This page gives an overview about the ValidationUtils in the *PowerSystemDataModel*.

## What are the ValidationUtils?
The methods in ValidationUtils and subclasses can be used to check that objects are valid, meaning their parameters have valid values and they are correctly connected.
The methods in ValidationUtils and subclasses can be used to check that objects are valid. The checks can be separated into two types:
1. General validation
2. Uniqueness validation


## What is checked?
- The check methods include checks that assigned values are valid, e.g. lines are not allowed to have negative lengths or the rated power factor of any unit must be between 0 and 1.
- Furthermore, several connections are checked, e.g. that lines only connect nodes of the same voltage level or that the voltage levels indicated for the transformer sides match the voltage levels of the nodes they are connected to.
The general validation checks:
- if assigned values are valid, e.g. lines are not allowed to have negative lengths or the rated power factor of any unit must be between 0 and 1
- furthermore, several connections are checked, e.g. that lines only connect nodes of the same voltage level or that the voltage levels indicated for the transformer sides match the voltage levels of the nodes they are connected to.
- the connectivity of the given grid for all defined operation intervals

The uniqueness validation checks if a collection of given objects are unique in either:
- a specific field
- or in a combination of multiple fields

For example `AssetInputs` needs to be unique in their `uuid` and in their `id` while
`weather values` needs to be unique in the combination of their `time` and their `coordinate`.


## How to use?
- To use the general validation the user should call the method `ValidationUtils.check(Object)`.
- To use the uniqueness validation the user should call a method of `UniquenessValidationUtils` to check the uniqueness.

## How does the general validation work?

## How does it work?
- The method `ValidationUtils.check(Object)` is the only method that should be called by the user.
- This check method identifies the object class and forwards it to a specific check method for the given object
- The method `ValidationUtils.check(Object)` identifies the object class and forwards it to a specific check method for the given object
- The overall structure of the ValidationUtils methods follows a cascading scheme, orientated along the class tree
- Example: A `LineInput lineInput` should be checked
1. `ValidationUtils.check(lineInput)` is called
Expand Down Expand Up @@ -49,15 +66,14 @@ The ValidationUtils include validation checks for...
- PvInput
- StorageInput
- WecInput
- (missing: EvcsInput)
- EvcsInput (also checks ChargingPointType)
- SystemParticipantTypeInput
- BmTypeInput
- ChpTypeInput
- EvTypeInput
- HpTypeInput
- StorageTypeInput
- WecTypeInput
- (missing: EvcsTypeInput/ChargingPointType)
- ThermalUnitValidationUtils
- ThermalUnitInput
- ThermalSinkInput
Expand Down
Loading

0 comments on commit 4243e57

Please sign in to comment.