Skip to content

Commit

Permalink
dev merge
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinheintze committed Nov 27, 2024
2 parents 3dc7523 + e420a54 commit c6dda91
Show file tree
Hide file tree
Showing 218 changed files with 6,289 additions and 4,070 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# © 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: 0

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Check Branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branchName="${{ github.head_ref }}"
else
branchName="${{ github.ref_name }}"
fi
if [[ "$branchName" == refs/heads/* ]]; then
branchName="${branchName#refs/heads/}"
fi
./gradlew checkBranchName -PbranchName="$branchName"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- 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 }}
52 changes: 49 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Enhanced Newton-Raphson-PowerFlow failures with more information [#815](https://github.com/ie3-institute/simona/issues/815)
- Update RTD references and bibliography [#868](https://github.com/ie3-institute/simona/issues/868)
- Add gradle application plugin for command line execution with gradle run [#890](https://github.com/ie3-institute/simona/issues/890)
- Additional tests to check flexibility options of thermal house and storage [#729](https://github.com/ie3-institute/simona/issues/729)
- EmAgents should be able to handle initialization [#945](https://github.com/ie3-institute/simona/issues/945)
- 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)
- Update/enhance config documentation [#1013](https://github.com/ie3-institute/simona/issues/1013)
- Create `CITATION.cff` [#1035](https://github.com/ie3-institute/simona/issues/1035)
- Introduce ThermalDemandWrapper [#1049](https://github.com/ie3-institute/simona/issues/1049)

### Changed
- Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435)
Expand Down Expand Up @@ -70,14 +80,37 @@ 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)
- Updated AUTHORS.md [#904](https://github.com/ie3-institute/simona/issues/904)
- Updated `Gradle` to version V8.10 [#829](https://github.com/ie3-institute/simona/issues/829)
- Updated AUTHORS.md [#905](https://github.com/ie3-institute/simona/issues/905)
- Rewrote BMModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- Refactoring EM messages [#947](https://github.com/ie3-institute/simona/issues/947)
- Simplifying ThermalHouse [#940](https://github.com/ie3-institute/simona/issues/940)
- Prepare ThermalStorageTestData for Storage without storageVolumeLvlMin [#894](https://github.com/ie3-institute/simona/issues/894)
- Renamed `ActivityStartTrigger`, `ScheduleTriggerMessage`, `CompletionMessage` in UML Diagrams[#675](https://github.com/ie3-institute/simona/issues/675)
- Simplifying quantity integration in QuantityUtil [#973](https://github.com/ie3-institute/simona/issues/973)
- Reorganized Jenkins pipeline to separate build and test stages for better efficiency [#938](https://github.com/ie3-institute/simona/issues/938)
- Rewrote SystemParticipantTest and MockParticipant from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- Rewrote ChpModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- 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)
- Fix implausible test cases of HpModelSpec [#1042](https://github.com/ie3-institute/simona/issues/1042)
- Refactoring to only use 'lastHpState' and 'relevantData' for 'ThermalGrid' calculations [#916](https://github.com/ie3-institute/simona/issues/916)
- Refactor thermal calcRelevantData [#1051](https://github.com/ie3-institute/simona/issues/1051)

### 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)
Expand All @@ -100,6 +133,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed FixedFeedModelSpec [#861](https://github.com/ie3-institute/simona/issues/861)
- Fixing duration calculation in result events [#801](https://github.com/ie3-institute/simona/issues/801)
- Handle MobSim requests for current prices [#892](https://github.com/ie3-institute/simona/issues/892)
- Fix determineState of ThermalHouse [#926](https://github.com/ie3-institute/simona/issues/926)
- Fix activation of Hp when not under control of an EM [#922](https://github.com/ie3-institute/simona/issues/922)
- Fix expected secondaryData in baseStateData [#955](https://github.com/ie3-institute/simona/issues/955)
- Improve code quality in fixedloadmodelspec and other tests [#919](https://github.com/ie3-institute/simona/issues/919)
- Fix power flow calculation with em agents [#962](https://github.com/ie3-institute/simona/issues/962)
- Fix scheduling at Evcs with more than one Ev at a time without Em [#787](https://github.com/ie3-institute/simona/issues/787)
- 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)
- Shallow fetch in CI [#1041](https://github.com/ie3-institute/simona/issues/1041)
- Correct wrong use of term "wall clock time" [#727](https://github.com/ie3-institute/simona/issues/727)

## [3.0.0] - 2023-08-07

Expand Down Expand Up @@ -162,7 +210,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)
Expand Down Expand Up @@ -193,12 +240,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)
Expand Down
41 changes: 41 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cff-version: 1.2.0
title: SIMONA
message: "If you use this software, please cite it as below."
type: software
authors:
- family-names: Hiry
given-names: Johannes
orcid: https://orcid.org/0000-0002-1447-0607
- family-names: Kittl
given-names: Chris
orcid: https://orcid.org/0000-0002-1187-0568
- family-names: Sen Sarma
given-names: Debopama
orcid: https://orcid.org/0000-0003-3311-3020
- family-names: Oberließen
given-names: Thomas
orcid: https://orcid.org/0000-0001-5805-5408
- family-names: Peter
given-names: Sebastian
orcid: https://orcid.org/0000-0001-6311-6113
- family-names: Feismann
given-names: Daniel
orcid: https://orcid.org/0000-0002-3531-9025
- family-names: Bao
given-names: Johannes
orcid: https://orcid.org/0009-0008-3641-6469
- family-names: Hohmann
given-names: Julian
- family-names: Staudt
given-names: Marius
repository-code: https://github.com/ie3-institute/simona
url: https://simona.ie3.e-technik.tu-dortmund.de
repository-artifact: https://central.sonatype.com/artifact/com.github.ie3-institute/simona
keywords:
- agent-based
- discrete-event simulation
- powerflow
- electricity distribution grid
license: BSD-3-Clause
version: 3.0.0
date-released: 2023-08-07
24 changes: 11 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,31 +101,32 @@ node {
}
}

// Build the project
stage('build') {
gradle('clean assemble', projectName)
}

// test the project
stage('run tests') {

sh 'java -version'

gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest reportScoverage checkScoverage', projectName)
gradle('--refresh-dependencies spotlessCheck test', projectName)

sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc''', returnStdout: true)
}

// sonarqube analysis
stage('sonarqube analysis') {
// sonarqube analysis & quality gate
stage('sonarqube') {
String sonarqubeCurrentBranchName = prFromFork() ? prJsonObj.head.repo.full_name : currentBranchName // forks needs to be handled differently
String sonarqubeCmd = determineSonarqubeGradleCmd(sonarqubeProjectKey, sonarqubeCurrentBranchName, targetBranchName, orgName, projectName, projectName)
withSonarQubeEnv() {
// will pick the global server connection from jenkins for sonarqube
gradle(sonarqubeCmd, projectName)
}
}

// sonarqube quality gate
stage("quality gate") {
timeout(time: 1, unit: 'HOURS') {
// just in case something goes wrong, pipeline will be killed after a timeout
def qg = waitForQualityGate() // reuse taskId previously collected by withSonarQubeEnv
// Just in case something goes wrong, pipeline will be killed after a timeout
def qg = waitForQualityGate() // Reuse taskId previously collected by withSonarQubeEnv
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
Expand Down Expand Up @@ -420,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: ''])

Expand Down Expand Up @@ -684,4 +682,4 @@ def getBranchType(String branchName) {
} else {
return null
}
}
}
23 changes: 11 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -25,12 +24,12 @@ ext {
javaVersion = JavaVersion.VERSION_17

scalaVersion = '2.13'
scalaBinaryVersion = '2.13.14'
pekkoVersion = '1.0.3'
jtsVersion = '1.19.0'
scalaBinaryVersion = '2.13.15'
pekkoVersion = '1.1.2'
jtsVersion = '1.20.0'
confluentKafkaVersion = '7.4.0'
tscfgVersion = '1.0.0'
scapegoatVersion = '3.0.0'
tscfgVersion = '1.1.3'
scapegoatVersion = '3.1.2'

testContainerVersion = '0.41.4'

Expand All @@ -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
Expand All @@ -56,6 +54,7 @@ apply from: scriptsLocation + 'scoverage.gradle' // scoverage scala code coverag
apply from: scriptsLocation + 'deploy.gradle'
apply from: scriptsLocation + 'semVer.gradle'
apply from: scriptsLocation + 'mavenCentralPublish.gradle'
apply from: scriptsLocation + 'branchName.gradle'

configurations {
scalaCompilerPlugin
Expand Down Expand Up @@ -98,12 +97,12 @@ dependencies {

/* logging */
implementation "com.typesafe.scala-logging:scala-logging_${scalaVersion}:3.9.5" // pekko scala logging
implementation "ch.qos.logback:logback-classic:1.5.7"
implementation "ch.qos.logback:logback-classic:1.5.12"

/* testing */
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation 'org.scalatestplus:mockito-3-4_2.13:3.2.10.0'
testImplementation 'org.mockito:mockito-core:5.12.0' // mocking framework
testImplementation 'org.mockito:mockito-core:5.14.2' // mocking framework
testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.19"
testRuntimeOnly 'com.vladsch.flexmark:flexmark-all:0.64.8' //scalatest html output
testImplementation group: 'org.pegdown', name: 'pegdown', version: '1.6.0'
Expand Down Expand Up @@ -147,9 +146,9 @@ 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.11.0'
implementation 'org.apache.commons:commons-csv:1.12.0'
implementation 'org.scalanlp:breeze_2.13:2.1.0' // scientific calculations (http://www.scalanlp.org/)
implementation 'de.lmu.ifi.dbs.elki:elki:0.7.5' // Statistics (for random load model)
implementation 'org.jgrapht:jgrapht-core:1.5.2'
Expand Down
Loading

0 comments on commit c6dda91

Please sign in to comment.