diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..182819f0a1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +# © 2024. TU Dortmund University, +# Institute of Energy Systems, Energy Efficiency and Energy Economics, +# Research group Distribution grid planning and operation +# + +name: CI + +on: + push: + paths-ignore: + - 'docs/**' + branches: + - main + - dev + - 'hotfix/*' + - 'rel/*' + - 'dependabot/*' + pull_request: + branches: + - main + - dev + +jobs: + buildAndTest: + runs-on: ubuntu-latest + + steps: + - name: Checkout Source + uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.ref || github.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build Project + run: ./gradlew --refresh-dependencies clean assemble spotlessCheck + + - name: Run Tests + run: ./gradlew test reportScoverage checkScoverage + + - name: Build Scala-Docs + run: ./gradlew scaladoc + + - name: SonarQube + run: | + ./gradlew sonar \ + -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} \ + -Dsonar.host.url=${{ vars.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} + + SONAR_STATUS_URL="${{ vars.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=${{ vars.SONAR_PROJECT_KEY }}" + QUALITY_GATE_STATUS=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" "$SONAR_STATUS_URL" | jq -r '.projectStatus.status') + + echo "Quality Gate Status: $QUALITY_GATE_STATUS" + if [ "$QUALITY_GATE_STATUS" != "OK" ]; then + echo "Quality Gate failed!" + exit 1 + fi + + - name: Deploy + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' + run: | + ./gradlew publish\ + -Puser=${{ secrets.MAVENCENTRAL_USER }} \ + -Ppassword=${{ secrets.MAVENCENTRAL_PASS }} \ + -Psigning.keyId=${{ secrets.MAVENCENTRAL_SIGNINGKEYID }} \ + -Psigning.password=${{ secrets.MAVENCENTRAL_SIGNINGPASS }} \ + -Psigning.secretKeyRingFile=${{ secrets.MAVENCENTRAL_SIGNINGKEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 223be89be4..4c42a0b055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added option to directly zip the output files [#793](https://github.com/ie3-institute/simona/issues/793) - Added weatherData HowTo for Copernicus ERA5 data [#967](https://github.com/ie3-institute/simona/issues/967) - Add some quote to 'printGoodbye' [#997](https://github.com/ie3-institute/simona/issues/997) +- Add unapply method for ThermalHouseResults [#934](https://github.com/ie3-institute/simona/issues/934) +- Added `ApparentPower` to differentiate between different power types [#794](https://github.com/ie3-institute/simona/issues/794) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) @@ -75,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated dependabot reviewers [#888](https://github.com/ie3-institute/simona/issues/888) - Merged `HpModelTestData` with `HpTestData` to `HpInputTestData` [#872](https://github.com/ie3-institute/simona/issues/872) - Harmonised both methods that check the inner temperature of thermal house against the boundaries [#880](https://github.com/ie3-institute/simona/issues/880) +- Changed implementation of actor naming for unique name generation [#103](https://github.com/ie3-institute/simona/issues/103) - Convert all `eval-rst` instances in rtd to myst syntax [#901](https://github.com/ie3-institute/simona/issues/901) - External simulation should provide information about next tick of MobSim [#776](https://github.com/ie3-institute/simona/issues/776) - Reverted temporary workaround in `spotless.gradle` [#681](https://github.com/ie3-institute/simona/issues/681) @@ -93,8 +96,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote CylindricalThermalStorageTest Test from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Replace mutable var in ChpModelSpec [#1002](https://github.com/ie3-institute/simona/issues/1002) - Move compression of output files into `ResultEventListener`[#965](https://github.com/ie3-institute/simona/issues/965) +- Rewrote StorageModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) +- Updated `ExtEvSimulationClasses` [#898](https://github.com/ie3-institute/simona/issues/898) +- Refactoring of `ThermalGrid.energyGrid` to distinguish between demand of house and storage [#928](https://github.com/ie3-institute/simona/issues/928) +- Refactoring to use zeroKW and zeroKWH in thermal grid unit tests [#1023](https://github.com/ie3-institute/simona/issues/1023) +- Refactor `ResultFileHierarchy` [#1031](https://github.com/ie3-institute/simona/issues/1031) +- Removing logs in `logs/simona` [#1017](https://github.com/ie3-institute/simona/issues/1017) ### Fixed +- Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) - Removed version number "2.0" from the logo printed to console [#642](https://github.com/ie3-institute/simona/issues/642) - Fixed PV Model documentation [#684](https://github.com/ie3-institute/simona/issues/684), [#686](https://github.com/ie3-institute/simona/issues/686) @@ -126,6 +136,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix CheckWindow duration [#921](https://github.com/ie3-institute/simona/issues/921) - Fixed ThermalStorageResults having multiple entries [#924](https://github.com/ie3-institute/simona/issues/924) - Fix filter for thermal result checking for lastTick not for currentTick [#1008](https://github.com/ie3-institute/simona/issues/1008) +- Fixed `CHANGELOG` entry for issue ([#103](https://github.com/ie3-institute/simona/issues/103)) [#941](https://github.com/ie3-institute/simona/issues/941) +- Fix grammar and spelling in docs and comments [#1022](https://github.com/ie3-institute/simona/issues/1022) +- Fix some minor issues and findings from inspections [#1019](https://github.com/ie3-institute/simona/issues/1019) +- Fix initialisation freezing on empty primary data [#981](https://github.com/ie3-institute/simona/issues/981) ## [3.0.0] - 2023-08-07 @@ -188,7 +202,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed format of example grid `vn_simona` [#216](https://github.com/ie3-institute/simona/issues/216) - Renamed ChpData to ChpRelevantData [#494](https://github.com/ie3-institute/simona/issues/494) - Updated gradle to 8.2.1, cleaned up `build.gradle` and `Jenkinsfile` [#572](https://github.com/ie3-institute/simona/issues/572) -- Changed implementation of actor naming for unique name generation [#103](https://github.com/ie3-institute/simona/issues/103) ### Fixed - Location of `vn_simona` test grid (was partially in Berlin and Dortmund) [#72](https://github.com/ie3-institute/simona/issues/72) @@ -219,12 +232,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for three winding transformers [#63](https://github.com/ie3-institute/simona/issues/63) - Handle incoming slack voltage accordingly - Allow multiple sub grid gates at one node (also allows multiple two winding transformers at one node) - - Perform power flow calculation in highest grid, if a three winding transformer is apparent + - Perform power flow calculation in the highest grid, if a three winding transformer is apparent - Write out results - Fixed broken layout in RTD documentation [#500](https://github.com/ie3-institute/simona/issues/500) - Corrected tests in RefSystemTest [#560](https://github.com/ie3-institute/simona/issues/560) - Take log file event filters from `logback.xml` when defining the run log appender [#108](https://github.com/ie3-institute/simona/issues/108) -- Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) ### Removed - Remove workaround for tscfg tmp directory [#178](https://github.com/ie3-institute/simona/issues/178) diff --git a/Jenkinsfile b/Jenkinsfile index f8320f0960..84b3073e05 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -111,7 +111,7 @@ node { sh 'java -version' - gradle('--refresh-dependencies spotlessCheck pmdMain pmdTest', projectName) + gradle('--refresh-dependencies spotlessCheck test', projectName) sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc''', returnStdout: true) } @@ -421,9 +421,6 @@ def publishReports(String relativeProjectDir) { // publish test reports publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/allTests', reportFiles: 'index.html', reportName: "${relativeProjectDir}_java_tests_report", reportTitles: '']) - // publish pmd report for main project only - publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/pmd', reportFiles: 'main.html', reportName: "${relativeProjectDir}_pmd_report", reportTitles: '']) - // publish scalatest reports for main project only (currently the only one with scala sources!) publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/scalatest', reportFiles: 'index.html', reportName: "${relativeProjectDir}_scala_tests_report", reportTitles: '']) diff --git a/build.gradle b/build.gradle index 01935529d3..a69e01e63d 100644 --- a/build.gradle +++ b/build.gradle @@ -6,13 +6,12 @@ plugins { id 'scala' // scala support id 'signing' id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined) - id 'pmd' // code check, working on source code id 'com.diffplug.spotless' version '6.25.0'// code format id "com.github.ben-manes.versions" version '0.51.0' id "de.undercouch.download" version "5.6.0" // downloads plugin id "kr.motd.sphinx" version "2.10.1" // documentation generation id "com.github.johnrengelman.shadow" version "8.1.1" // fat jar - id "org.sonarqube" version "5.1.0.4882" // sonarqube + id "org.sonarqube" version "6.0.0.5145" // sonarqube id "org.scoverage" version "8.1" // scala code coverage scoverage id "com.github.maiflai.scalatest" version "0.32" // run scalatest without specific spec task id 'org.hidetake.ssh' version '2.11.2' @@ -45,7 +44,6 @@ java { targetCompatibility = javaVersion } -apply from: scriptsLocation + 'pmd.gradle' apply from: scriptsLocation + 'spotless.gradle' apply from: scriptsLocation + 'checkJavaVersion.gradle' apply from: scriptsLocation + 'tscfg.gradle' // config tasks @@ -147,7 +145,7 @@ dependencies { implementation 'org.apache.commons:commons-math3:3.6.1' // apache commons math3 implementation 'org.apache.poi:poi-ooxml:5.3.0' // used for FilenameUtils implementation 'javax.measure:unit-api:2.2' - implementation 'tech.units:indriya:2.2' // quantities + implementation 'tech.units:indriya:2.2.1' // quantities implementation "org.typelevel:squants_${scalaVersion}:1.8.3" implementation 'org.apache.commons:commons-csv:1.12.0' implementation 'org.scalanlp:breeze_2.13:2.1.0' // scientific calculations (http://www.scalanlp.org/) diff --git a/docs/readthedocs/developersguide.md b/docs/readthedocs/developersguide.md index ace59e05e6..a246fc106a 100644 --- a/docs/readthedocs/developersguide.md +++ b/docs/readthedocs/developersguide.md @@ -2,7 +2,7 @@ # Developer’s Guide -The SIMONA repository can be found [on Github](https://github.com/ie3-institute/simona). +The SIMONA repository can be found [on GitHub](https://github.com/ie3-institute/simona). ```{contents} --- diff --git a/docs/readthedocs/models/chp_model.md b/docs/readthedocs/models/chp_model.md index c5f01364bf..d7eb8232eb 100644 --- a/docs/readthedocs/models/chp_model.md +++ b/docs/readthedocs/models/chp_model.md @@ -6,7 +6,7 @@ This page documents the functionality of the CHP Model (combined heat and power ## Assumptions -The CHP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the CHP unit does not posses a memory. Losses of the heat storage are not considered. +The CHP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the CHP unit does not possess a memory. Losses of the heat storage are not considered. ## Parameters diff --git a/docs/readthedocs/models/cts_model.md b/docs/readthedocs/models/cts_model.md index 5750820624..e03fa06563 100644 --- a/docs/readthedocs/models/cts_model.md +++ b/docs/readthedocs/models/cts_model.md @@ -3,7 +3,7 @@ This page documents the functionality of the cylindrical thermal storage available in SIMONA. ## Behaviour -This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore it is assumed that the storage medium is water. Also the model holds a variable for the current storage level. +This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore, it is assumed that the storage medium is water. Also, the model holds a variable for the current storage level. ## Attributes, Units and Remarks diff --git a/docs/readthedocs/models/em.md b/docs/readthedocs/models/em.md index ae10cb3ac2..ea7261d4f8 100644 --- a/docs/readthedocs/models/em.md +++ b/docs/readthedocs/models/em.md @@ -16,7 +16,7 @@ If an EmAgent is itself controlled by another EmAgent, it also behaves like a sy Every EmAgent aggregates flex options and power of its connected assets and disaggregates flex control among the connected assets. It also functions as a scheduler for all connected assets by processing information on the ticks of the next desired activations and conveying such information to the controlling EmAgent or a central scheduler respectively. -Uncontrolled EmAgents answer to a scheduler with regards to their activation. +Uncontrolled EmAgents answer to a scheduler with regard to their activation. ![](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/ie3-institute/simona/dev/docs/uml/protocol/em/UncontrolledEm.puml) diff --git a/docs/readthedocs/models/hp_model.md b/docs/readthedocs/models/hp_model.md index 0458fffbac..8070e36f36 100644 --- a/docs/readthedocs/models/hp_model.md +++ b/docs/readthedocs/models/hp_model.md @@ -6,7 +6,7 @@ This page documents the functionality of the Heat Pump Model (HP model) availabl ## Assumptions -The HP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the HP unit does not posses a memory. +The HP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the HP unit does not possess a memory. ## Parameters @@ -17,6 +17,6 @@ Please refer to {doc}`PowerSystemDataModel - HP Model