From d327a22b0c14ddcc3dd6c0b7b850d29e4da22b21 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Mon, 1 Jul 2024 11:43:09 +0200 Subject: [PATCH 01/11] Rewrote SystemComponentSpec from groovy to scala --- CHANGELOG.md | 1 + .../simona/model/SystemComponentTest.groovy | 68 ----------- .../simona/model/SystemComponentSpec.scala | 108 ++++++++++++++++++ 3 files changed, 109 insertions(+), 68 deletions(-) delete mode 100644 src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy create mode 100644 src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d10d20b89..2267babac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote PVModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Making configuration of `RefSystem` via config optional [#769](https://github.com/ie3-institute/simona/issues/769) - Updated PSDM to version 5.1.0 [#835](https://github.com/ie3-institute/simona/issues/835) +- Rewrote SystemComponentTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy b/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy deleted file mode 100644 index 354f3b3248..0000000000 --- a/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy +++ /dev/null @@ -1,68 +0,0 @@ -/* - * © 2020. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package edu.ie3.simona.model - -import edu.ie3.datamodel.models.OperationTime -import edu.ie3.simona.exceptions.InvalidParameterException -import edu.ie3.util.TimeUtil -import edu.ie3.util.scala.OperationInterval -import scala.Option -import spock.lang.Shared -import spock.lang.Specification - -import java.time.ZonedDateTime - -class SystemComponentTest extends Specification { - @Shared - OperationTime.OperationTimeBuilder operationTimeBuilder - - def setup() { - operationTimeBuilder = OperationTime.builder() - } - - def "Determine the correct operation interval"(Option operationStart, Option operationEnd, OperationInterval expected) { - given: - ZonedDateTime simulationStart = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - ZonedDateTime simulationEnd = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - - if(operationStart.defined) - operationTimeBuilder.withStart(operationStart.get()) - if(operationEnd.defined) - operationTimeBuilder.withEnd(operationEnd.get()) - OperationTime operationTime = operationTimeBuilder.build() - - and: - OperationInterval interval = SystemComponent.determineOperationInterval(simulationStart, simulationEnd, operationTime) - - expect: - interval == expected - - where: - operationStart | operationEnd | expected - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | OperationInterval.apply(0L, 86400L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | OperationInterval.apply(86400L, 86400L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | OperationInterval.apply(0L, 0L) - Option.apply(null) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | OperationInterval.apply(0L, 0L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | Option.apply(null) | OperationInterval.apply(86400L, 86400L) - } - - def "Reject an operation end, that is before the operation start"() { - given: - ZonedDateTime simulationStart = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - ZonedDateTime simulationEnd = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - operationTimeBuilder.withStart(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) - operationTimeBuilder.withEnd(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) - OperationTime operationTime = operationTimeBuilder.build() - - when: - SystemComponent.determineOperationInterval(simulationStart, simulationEnd, operationTime) - - then: - def exception = thrown(InvalidParameterException.class) - exception.message == "The defined operation end is before it's operation start." - } -} diff --git a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala new file mode 100644 index 0000000000..dd8778b83a --- /dev/null +++ b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala @@ -0,0 +1,108 @@ +/* + * © 2020. TU Dortmund University, + * Institute of Energy Systems, Energy Efficiency and Energy Economics, + * Research group Distribution grid planning and operation + */ + +package edu.ie3.simona.model + +import edu.ie3.datamodel.models.OperationTime +import edu.ie3.simona.exceptions.InvalidParameterException +import edu.ie3.util.TimeUtil +import edu.ie3.util.scala.OperationInterval +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers +import java.time.ZonedDateTime + +class SystemComponentSpec extends AnyFlatSpec with Matchers { + + var operationTimeBuilder: OperationTime.OperationTimeBuilder = _ + + def setup(): Unit = { + operationTimeBuilder = OperationTime.builder() + } + + "SystemComponent" should "determine the correct operation interval" in { + + val simulationStart: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") + val simulationEnd: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") + + val testCases = Seq( + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + OperationInterval(0L, 86400L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + OperationInterval(86400L, 86400L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + OperationInterval(0L, 0L), + ), + ( + None, + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + OperationInterval(0L, 0L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + None, + OperationInterval(86400L, 86400L), + ), + ) + + for ((operationStart, operationEnd, expected) <- testCases) { + setup() + + operationStart.foreach(operationTimeBuilder.withStart) + operationEnd.foreach(operationTimeBuilder.withEnd) + + val operationTime: OperationTime = operationTimeBuilder.build() + + val interval: OperationInterval = + SystemComponent.determineOperationInterval( + simulationStart, + simulationEnd, + operationTime, + ) + + interval should be(expected) + } + } + + it should "reject an operation end that is before the operation start" in { + val simulationStart: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") + val simulationEnd: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") + + setup() + + operationTimeBuilder.withStart( + TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") + ) + operationTimeBuilder.withEnd( + TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") + ) + val operationTime: OperationTime = operationTimeBuilder.build() + + val exception = intercept[InvalidParameterException] { + SystemComponent.determineOperationInterval( + simulationStart, + simulationEnd, + operationTime, + ) + } + + exception.getMessage should be( + "The defined operation end is before it's operation start." + ) + } + +} From 1505cc0f68979e260373ec9bab204f2262ee5732 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Mon, 1 Jul 2024 12:02:49 +0200 Subject: [PATCH 02/11] Fix Codacy: (mutable fields) are deprecated if you're using a strict functional style. --- .../edu/ie3/simona/model/SystemComponentSpec.scala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala index dd8778b83a..b94080520d 100644 --- a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala @@ -16,10 +16,8 @@ import java.time.ZonedDateTime class SystemComponentSpec extends AnyFlatSpec with Matchers { - var operationTimeBuilder: OperationTime.OperationTimeBuilder = _ - - def setup(): Unit = { - operationTimeBuilder = OperationTime.builder() + def setup(): OperationTime.OperationTimeBuilder = { + OperationTime.builder() } "SystemComponent" should "determine the correct operation interval" in { @@ -58,7 +56,7 @@ class SystemComponentSpec extends AnyFlatSpec with Matchers { ) for ((operationStart, operationEnd, expected) <- testCases) { - setup() + val operationTimeBuilder = setup() operationStart.foreach(operationTimeBuilder.withStart) operationEnd.foreach(operationTimeBuilder.withEnd) @@ -82,7 +80,7 @@ class SystemComponentSpec extends AnyFlatSpec with Matchers { val simulationEnd: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - setup() + val operationTimeBuilder = setup() operationTimeBuilder.withStart( TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") From 98264204bbfbbb9820e8ae441e8877cdf16afb62 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Sun, 7 Jul 2024 17:03:16 +0200 Subject: [PATCH 03/11] Refactor SystemComponentSpec to use default simulation times --- .../simona/model/SystemComponentSpec.scala | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala index b94080520d..a48181a9df 100644 --- a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala @@ -22,9 +22,9 @@ class SystemComponentSpec extends AnyFlatSpec with Matchers { "SystemComponent" should "determine the correct operation interval" in { - val simulationStart: ZonedDateTime = + val defaultSimulationStart: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val simulationEnd: ZonedDateTime = + val defaultSimulationEnd: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") val testCases = Seq( @@ -65,8 +65,8 @@ class SystemComponentSpec extends AnyFlatSpec with Matchers { val interval: OperationInterval = SystemComponent.determineOperationInterval( - simulationStart, - simulationEnd, + defaultSimulationStart, + defaultSimulationEnd, operationTime, ) @@ -75,25 +75,21 @@ class SystemComponentSpec extends AnyFlatSpec with Matchers { } it should "reject an operation end that is before the operation start" in { - val simulationStart: ZonedDateTime = + val defaultSimulationStart: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val simulationEnd: ZonedDateTime = + val defaultSimulationEnd: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") val operationTimeBuilder = setup() - operationTimeBuilder.withStart( - TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - ) - operationTimeBuilder.withEnd( - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - ) + operationTimeBuilder.withStart(defaultSimulationEnd) + operationTimeBuilder.withEnd(defaultSimulationStart) val operationTime: OperationTime = operationTimeBuilder.build() val exception = intercept[InvalidParameterException] { SystemComponent.determineOperationInterval( - simulationStart, - simulationEnd, + defaultSimulationStart, + defaultSimulationEnd, operationTime, ) } From e78698c03d3f654a146321fe250f9ee281b4b69f Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Thu, 25 Jul 2024 12:04:05 +0200 Subject: [PATCH 04/11] Move Model/SystemComponentSpec.scala in Grid/SystemComponentSpec.scala. Delete Model/SystemComponentSpec.scala. --- .../model/grid/SystemComponentSpec.scala | 88 ++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala index c9668e16d2..2f8a6c55ca 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala @@ -6,13 +6,17 @@ package edu.ie3.simona.model.grid -import java.util.UUID +import edu.ie3.datamodel.models.OperationTime +import edu.ie3.simona.exceptions.InvalidParameterException +import java.util.UUID import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.grid.SystemComponentSpec.SystemComponentMock import edu.ie3.simona.test.common.UnitSpec +import edu.ie3.util.TimeUtil import edu.ie3.util.scala.OperationInterval +import java.time.ZonedDateTime import scala.util.Try /** Test for abstract class [[SystemComponent]] @@ -62,6 +66,88 @@ class SystemComponentSpec extends UnitSpec { } + def setup(): OperationTime.OperationTimeBuilder = { + OperationTime.builder() + } + + "determine the correct operation interval" in { + + val defaultSimulationStart: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") + val defaultSimulationEnd: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") + + val testCases = Seq( + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + OperationInterval(0L, 86400L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + OperationInterval(86400L, 86400L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + OperationInterval(0L, 0L), + ), + ( + None, + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), + OperationInterval(0L, 0L), + ), + ( + Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), + None, + OperationInterval(86400L, 86400L), + ), + ) + + for ((operationStart, operationEnd, expected) <- testCases) { + val operationTimeBuilder = setup() + + operationStart.foreach(operationTimeBuilder.withStart) + operationEnd.foreach(operationTimeBuilder.withEnd) + + val operationTime: OperationTime = operationTimeBuilder.build() + + val interval: OperationInterval = + SystemComponent.determineOperationInterval( + defaultSimulationStart, + defaultSimulationEnd, + operationTime, + ) + + interval should be(expected) + } + } + + "reject an operation end that is before the operation start" in { + val defaultSimulationStart: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") + val defaultSimulationEnd: ZonedDateTime = + TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") + + val operationTimeBuilder = setup() + + operationTimeBuilder.withStart(defaultSimulationEnd) + operationTimeBuilder.withEnd(defaultSimulationStart) + val operationTime: OperationTime = operationTimeBuilder.build() + + val exception = intercept[InvalidParameterException] { + SystemComponent.determineOperationInterval( + defaultSimulationStart, + defaultSimulationEnd, + operationTime, + ) + } + + exception.getMessage should be( + "The defined operation end is before it's operation start." + ) + } } } From 3e3728472598452437593f2ca891080947bc8ca3 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Fri, 26 Jul 2024 12:43:52 +0200 Subject: [PATCH 05/11] Fix simulation time, fmt --- .../simona/model/grid/SystemComponentSpec.scala | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala index 2f8a6c55ca..dce98587ad 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala @@ -12,7 +12,7 @@ import edu.ie3.simona.exceptions.InvalidParameterException import java.util.UUID import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.grid.SystemComponentSpec.SystemComponentMock -import edu.ie3.simona.test.common.UnitSpec +import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec} import edu.ie3.util.TimeUtil import edu.ie3.util.scala.OperationInterval @@ -21,7 +21,7 @@ import scala.util.Try /** Test for abstract class [[SystemComponent]] */ -class SystemComponentSpec extends UnitSpec { +class SystemComponentSpec extends UnitSpec with DefaultTestData { sealed trait ValidSystemComponent { val systemComponent: SystemComponentMock = SystemComponentMock( operationInterval = OperationInterval(0L, 7200L) @@ -72,9 +72,7 @@ class SystemComponentSpec extends UnitSpec { "determine the correct operation interval" in { - val defaultSimulationStart: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val defaultSimulationEnd: ZonedDateTime = + val simulationEnd: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") val testCases = Seq( @@ -116,7 +114,7 @@ class SystemComponentSpec extends UnitSpec { val interval: OperationInterval = SystemComponent.determineOperationInterval( defaultSimulationStart, - defaultSimulationEnd, + simulationEnd, operationTime, ) @@ -125,9 +123,8 @@ class SystemComponentSpec extends UnitSpec { } "reject an operation end that is before the operation start" in { - val defaultSimulationStart: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val defaultSimulationEnd: ZonedDateTime = + + val simulationEnd: ZonedDateTime = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") val operationTimeBuilder = setup() @@ -139,7 +136,7 @@ class SystemComponentSpec extends UnitSpec { val exception = intercept[InvalidParameterException] { SystemComponent.determineOperationInterval( defaultSimulationStart, - defaultSimulationEnd, + simulationEnd, operationTime, ) } From 012420053857abf816b24eaefb1317b28337615e Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Mon, 29 Jul 2024 17:04:08 +0200 Subject: [PATCH 06/11] Converting remaining rst files to markdown. --- CHANGELOG.md | 1 + docs/readthedocs/{index.rst => index.md} | 26 +++++++++++-------- .../{references.rst => references.md} | 17 +++++------- 3 files changed, 23 insertions(+), 21 deletions(-) rename docs/readthedocs/{index.rst => index.md} (68%) rename docs/readthedocs/{references.rst => references.md} (72%) diff --git a/CHANGELOG.md b/CHANGELOG.md index fecbf6cdab..651974b6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote RefSystemTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Rewrote FixedFeedModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Rewrote WecModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) +- Converting remaining rst files to markdown [#838](https://github.com/ie3-institute/simona/issues/838) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.md similarity index 68% rename from docs/readthedocs/index.rst rename to docs/readthedocs/index.md index 5ad7bc0ffd..65dd89f76a 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.md @@ -1,20 +1,24 @@ -Welcome to simona docs -====================== +# Welcome to simona docs +```{eval-rst} .. figure:: ../logo/logo_tightcrop_transparent.png :figwidth: 25% :align: right :alt: logo of simona +``` + Welcome to the documentation of simona - an agent-based discrete-event power system simulation model developed at the Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmund University, Germany. -.. toctree:: - :maxdepth: 2 - - about - usersguide - config - models - developersguide - references +```{toctree} +--- +maxdepth: 2 +--- +about +usersguide +config +models +developersguide +references +``` diff --git a/docs/readthedocs/references.rst b/docs/readthedocs/references.md similarity index 72% rename from docs/readthedocs/references.rst rename to docs/readthedocs/references.md index 678bf1fc59..fe2d88da7a 100644 --- a/docs/readthedocs/references.rst +++ b/docs/readthedocs/references.md @@ -1,27 +1,24 @@ -**************************** -Publications and References -**************************** +# Publications and References -Publications -=============== +## Publications The following publications discuss SIMONA and implementation details as well as outcomes where SIMONA have been used: +```{eval-rst} .. rubric:: SIMONA Publications .. bibliography:: _static/bibliography/bibAboutSimona.bib :style: unsrt :all: +``` - -References -=============== +## References References of publications SIMONA referred on: +```{eval-rst} .. rubric:: References .. bibliography:: _static/bibliography/bibtexAll.bib :style: custom :all: - - +``` From a6b69a3290d717ab7fd3ea37facc0de213615d0a Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Mon, 29 Jul 2024 22:14:00 +0200 Subject: [PATCH 07/11] Fixing `read the docs`. --- docs/readthedocs/conf.py | 2 +- docs/readthedocs/references.md | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/readthedocs/conf.py b/docs/readthedocs/conf.py index 6ec36e73ef..30a0c7334c 100644 --- a/docs/readthedocs/conf.py +++ b/docs/readthedocs/conf.py @@ -29,7 +29,7 @@ templates_path = ['_templates'] exclude_trees = ['.build'] -source_suffix = ['.rst', '.md'] +source_suffix = ['.md'] source_encoding = 'utf-8-sig' diff --git a/docs/readthedocs/references.md b/docs/readthedocs/references.md index fe2d88da7a..0aa2febc1e 100644 --- a/docs/readthedocs/references.md +++ b/docs/readthedocs/references.md @@ -5,18 +5,20 @@ The following publications discuss SIMONA and implementation details as well as outcomes where SIMONA have been used: ```{eval-rst} +The following publications discuss SIMONA and implementation details as well as outcomes where SIMONA have been used: + .. rubric:: SIMONA Publications .. bibliography:: _static/bibliography/bibAboutSimona.bib :style: unsrt :all: -``` -## References + +References +=============== References of publications SIMONA referred on: -```{eval-rst} .. rubric:: References .. bibliography:: _static/bibliography/bibtexAll.bib :style: custom From 34171a5aed23f3863e4c566a8a2dee3d912f0615 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Mon, 29 Jul 2024 22:32:54 +0200 Subject: [PATCH 08/11] Remove model\SystemComponentSpec.scala --- .../simona/model/SystemComponentSpec.scala | 102 ------------------ 1 file changed, 102 deletions(-) delete mode 100644 src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala diff --git a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala deleted file mode 100644 index a48181a9df..0000000000 --- a/src/test/scala/edu/ie3/simona/model/SystemComponentSpec.scala +++ /dev/null @@ -1,102 +0,0 @@ -/* - * © 2020. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package edu.ie3.simona.model - -import edu.ie3.datamodel.models.OperationTime -import edu.ie3.simona.exceptions.InvalidParameterException -import edu.ie3.util.TimeUtil -import edu.ie3.util.scala.OperationInterval -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers -import java.time.ZonedDateTime - -class SystemComponentSpec extends AnyFlatSpec with Matchers { - - def setup(): OperationTime.OperationTimeBuilder = { - OperationTime.builder() - } - - "SystemComponent" should "determine the correct operation interval" in { - - val defaultSimulationStart: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val defaultSimulationEnd: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - - val testCases = Seq( - ( - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), - OperationInterval(0L, 86400L), - ), - ( - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), - OperationInterval(86400L, 86400L), - ), - ( - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), - OperationInterval(0L, 0L), - ), - ( - None, - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")), - OperationInterval(0L, 0L), - ), - ( - Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")), - None, - OperationInterval(86400L, 86400L), - ), - ) - - for ((operationStart, operationEnd, expected) <- testCases) { - val operationTimeBuilder = setup() - - operationStart.foreach(operationTimeBuilder.withStart) - operationEnd.foreach(operationTimeBuilder.withEnd) - - val operationTime: OperationTime = operationTimeBuilder.build() - - val interval: OperationInterval = - SystemComponent.determineOperationInterval( - defaultSimulationStart, - defaultSimulationEnd, - operationTime, - ) - - interval should be(expected) - } - } - - it should "reject an operation end that is before the operation start" in { - val defaultSimulationStart: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - val defaultSimulationEnd: ZonedDateTime = - TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - - val operationTimeBuilder = setup() - - operationTimeBuilder.withStart(defaultSimulationEnd) - operationTimeBuilder.withEnd(defaultSimulationStart) - val operationTime: OperationTime = operationTimeBuilder.build() - - val exception = intercept[InvalidParameterException] { - SystemComponent.determineOperationInterval( - defaultSimulationStart, - defaultSimulationEnd, - operationTime, - ) - } - - exception.getMessage should be( - "The defined operation end is before it's operation start." - ) - } - -} From f1176d9e4703601f6fb2e9788149004ed1a95382 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 30 Jul 2024 09:49:45 +0200 Subject: [PATCH 09/11] update bibliography --- CHANGELOG.md | 1 + .../_static/bibliography/bibAboutSimona.bib | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1a7d264c..bacd8ce764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Printing the directory of log to terminal upon simulation failure [#626](https://github.com/ie3-institute/simona/issues/626) - Implementation of StorageAgent [#309](https://github.com/ie3-institute/simona/issues/309) - 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) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) diff --git a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib index 66c3a64e93..7e553bd5a9 100644 --- a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib +++ b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib @@ -8,6 +8,7 @@ @book{Hiry.2022 publisher = {Shaker}, isbn = {9783844084627}, series = {Dortmunder Beitr{\"a}ge zu Energiesystemen, Energieeffizienz und Energiewirtschaft} + doi = {10.17877/DE290R-22549} } @Book{Kittl.2022, @@ -311,3 +312,28 @@ @InProceedings{Kays.2011b address = {Bologna} } + @article{HIRY2022108365, + title = {Multi-voltage level distributed backward–forward sweep power flow algorithm in an agent-based discrete-event simulation framework}, + journal = {Electric Power Systems Research}, + volume = {213}, + pages = {108365}, + year = {2022}, + issn = {0378-7796}, + doi = {https://doi.org/10.1016/j.epsr.2022.108365}, + url = {https://www.sciencedirect.com/science/article/pii/S0378779622005326}, + author = {Johannes Hiry and Chris Kittl and Debopama Sen Sarma and Thomas Oberließen and Christian Rehtanz}, + keywords = {Agent-based modeling, Discrete-event systems, Distributed power generation, Load flow, Power system simulation}, + } + + @INPROCEEDINGS{10407568, + author={Sarma, Debopama Sen and Peter, Sebastian and Rehtanz, Christian}, + booktitle={2023 IEEE PES Innovative Smart Grid Technologies Europe (ISGT EUROPE)}, + title={A Distributed Framework for Agent-based Optimal Energy Management of Distribution Systems}, + year={2023}, + volume={}, + number={}, + pages={1-5}, + keywords={Data privacy;Europe;Systems simulation;Smart grids;Security;Energy management;Optimization;agent-based;distributed optimization;energy management;flexible prosumers;modern distribution networks}, + doi={10.1109/ISGTEUROPE56780.2023.10407568}} + + From 184c39b068b3b3ba011b3a734a21f9283e3f4e03 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 30 Jul 2024 09:53:10 +0200 Subject: [PATCH 10/11] fmt --- docs/readthedocs/_static/bibliography/bibAboutSimona.bib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib index 7e553bd5a9..e2a605e239 100644 --- a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib +++ b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib @@ -7,7 +7,7 @@ @book{Hiry.2022 volume = {24}, publisher = {Shaker}, isbn = {9783844084627}, - series = {Dortmunder Beitr{\"a}ge zu Energiesystemen, Energieeffizienz und Energiewirtschaft} + series = {Dortmunder Beitr{\"a}ge zu Energiesystemen, Energieeffizienz und Energiewirtschaft}, doi = {10.17877/DE290R-22549} } From b7296d4a9fd861ea9393afd0f5dca247d6de22b4 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Tue, 30 Jul 2024 12:23:17 +0200 Subject: [PATCH 11/11] Removing one empty line. --- docs/readthedocs/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/readthedocs/index.md b/docs/readthedocs/index.md index 65dd89f76a..714d51bcf2 100644 --- a/docs/readthedocs/index.md +++ b/docs/readthedocs/index.md @@ -7,7 +7,6 @@ :alt: logo of simona ``` - Welcome to the documentation of simona - an agent-based discrete-event power system simulation model developed at the Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmund University, Germany.