From 734b9b0bff5932085434da7e3193dc04ce7ac939 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Sun, 10 Mar 2024 17:53:40 +0100 Subject: [PATCH 01/22] Remove genindex and search --- docs/readthedocs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 68cc508bcb..533fcd0699 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -22,6 +22,5 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu Indices and tables ================== -* :ref:`genindex` * :ref:`modindex` -* :ref:`search` + From 0cedbf90a589efb29767f432220fe113ffbc9322 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 13 Mar 2024 08:33:21 +0100 Subject: [PATCH 02/22] test --- docs/readthedocs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 533fcd0699..336e31fd02 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -22,5 +22,5 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu Indices and tables ================== -* :ref:`modindex` +* :ref:`testindex` From 3efc5e6b407d2f705bfb9c7ef313ca9668d6d91f Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 13 Mar 2024 09:51:37 +0100 Subject: [PATCH 03/22] add All Pages page --- docs/readthedocs/all_pages.rst | 10 ++++++++++ docs/readthedocs/index.rst | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 docs/readthedocs/all_pages.rst diff --git a/docs/readthedocs/all_pages.rst b/docs/readthedocs/all_pages.rst new file mode 100644 index 0000000000..4d006cff2d --- /dev/null +++ b/docs/readthedocs/all_pages.rst @@ -0,0 +1,10 @@ +All Pages +========= + +Here are all available pages listed: + +.. toctree:: + :glob: + + * + diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 336e31fd02..47b7d6d834 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -22,5 +22,6 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu Indices and tables ================== -* :ref:`testindex` +For more information, please visit the :doc:`All Pages ` page. + From a5aaded890cdf5c76b54178ad4d606bd509c13a7 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 13 Mar 2024 09:54:16 +0100 Subject: [PATCH 04/22] CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c83520da4e..6b901013aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Config possibility for transformer control groups [#90](https://github.com/ie3-institute/simona/issues/90) - Implemented scaling of all relevant input parameters [#764](https://github.com/ie3-institute/simona/issues/764) - Consider scaling factor with flex options [#734](https://github.com/ie3-institute/simona/issues/734) +- New documentation index page [#375](https://github.com/ie3-institute/simona/issues/375) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) From 7ad0bf3b84148c9c93a7be6e01a4848798f6c45f Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 13 Mar 2024 10:55:45 +0100 Subject: [PATCH 05/22] fix warnings --- docs/readthedocs/all_pages.rst | 10 ---------- docs/readthedocs/allpages.md | 17 +++++++++++++++++ docs/readthedocs/conf.py | 1 - docs/readthedocs/index.rst | 3 ++- 4 files changed, 19 insertions(+), 12 deletions(-) delete mode 100644 docs/readthedocs/all_pages.rst create mode 100644 docs/readthedocs/allpages.md diff --git a/docs/readthedocs/all_pages.rst b/docs/readthedocs/all_pages.rst deleted file mode 100644 index 4d006cff2d..0000000000 --- a/docs/readthedocs/all_pages.rst +++ /dev/null @@ -1,10 +0,0 @@ -All Pages -========= - -Here are all available pages listed: - -.. toctree:: - :glob: - - * - diff --git a/docs/readthedocs/allpages.md b/docs/readthedocs/allpages.md new file mode 100644 index 0000000000..b97e268aa3 --- /dev/null +++ b/docs/readthedocs/allpages.md @@ -0,0 +1,17 @@ +(allpages)= + +# All Pages + +Here are all available pages listed: + +```{toctree} +--- +maxdepth: 1 +--- +.. toctree:: + :maxdepth: 2 + :glob: + + * + !allpages +``` \ No newline at end of file diff --git a/docs/readthedocs/conf.py b/docs/readthedocs/conf.py index a97c81859f..e78a262a87 100644 --- a/docs/readthedocs/conf.py +++ b/docs/readthedocs/conf.py @@ -44,7 +44,6 @@ # PlantUML options plantuml = 'plantuml' - # Intersphinx for references to external ReadTheDocs intersphinx_mapping = { 'psdm': ('https://powersystemdatamodel.readthedocs.io/en/latest/', None), diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 47b7d6d834..1360094243 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -18,10 +18,11 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu models developersguide references + allpages Indices and tables ================== -For more information, please visit the :doc:`All Pages ` page. +For more information, please visit the :doc:`All Pages ` page. From 0c1e1566f0907a75d6b5d41d23d74edafeba098f Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Wed, 13 Mar 2024 12:38:19 +0100 Subject: [PATCH 06/22] Print log directory to terminal upon simulation failure --- CHANGELOG.md | 1 + .../scala/edu/ie3/simona/main/RunSimona.scala | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c83520da4e..17f204d16c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Config possibility for transformer control groups [#90](https://github.com/ie3-institute/simona/issues/90) - Implemented scaling of all relevant input parameters [#764](https://github.com/ie3-institute/simona/issues/764) - Consider scaling factor with flex options [#734](https://github.com/ie3-institute/simona/issues/734) +- Printing the directory of log to terminal upon simulation failure [#626](https://github.com/ie3-institute/simona/issues/626) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) diff --git a/src/main/scala/edu/ie3/simona/main/RunSimona.scala b/src/main/scala/edu/ie3/simona/main/RunSimona.scala index 707da41338..3ba84bbef0 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimona.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimona.scala @@ -11,6 +11,8 @@ import edu.ie3.simona.sim.setup.SimonaSetup import edu.ie3.util.scala.quantities.QuantityUtil import org.apache.pekko.util.Timeout +import java.io.File +import java.nio.file.Path import java.util.Locale import scala.concurrent.duration.FiniteDuration import scala.util.Random @@ -39,7 +41,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { val successful = run(simonaSetup) - printGoodbye() + printGoodbye(successful) // prevents cutting of the log when having a fast simulation Thread.sleep(1000) @@ -54,7 +56,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { ) } - private def printGoodbye(): Unit = { + private def printGoodbye(successful: Boolean): Unit = { val myWords = Array( "\"Vielleicht ist heute ein besonders guter Tag zum Sterben.\" - Worf (in Star Trek: Der erste Kontakt)", "\"Assimiliert das!\" - Worf (in Star Trek: Der erste Kontakt)", @@ -68,6 +70,21 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { val randIdx = rand.nextInt(myWords.length) logger.info(myWords(randIdx)) logger.info("Goodbye!") + + if (!successful) { + // to ensure that the link to the log is printed last + Thread.sleep(1000) + + val root: Path = Path.of( + new File(".").getAbsoluteFile.getParent, + "logs", + "simona", + "simona.log", + ) + logger.error( + s"Simulation stopped due to the occurrence of an error! The full log can be found here: $root" + ) + } } /** Method to be implemented to setup everything that is necessary for a From 8404a12f6affa49fe83121a2607e91beaaf4347f Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Tue, 9 Apr 2024 18:28:54 +0200 Subject: [PATCH 07/22] Implementing requested change. --- .../scala/edu/ie3/simona/main/RunSimona.scala | 18 ++++++++---------- .../edu/ie3/simona/sim/setup/SimonaSetup.scala | 4 ++++ .../sim/setup/SimonaStandaloneSetup.scala | 2 ++ .../edu/ie3/simona/sim/SimonaSimSpec.scala | 2 ++ .../ie3/simona/sim/setup/SimonaSetupSpec.scala | 2 ++ 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/main/RunSimona.scala b/src/main/scala/edu/ie3/simona/main/RunSimona.scala index 3ba84bbef0..8265ed0cdb 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimona.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimona.scala @@ -11,7 +11,6 @@ import edu.ie3.simona.sim.setup.SimonaSetup import edu.ie3.util.scala.quantities.QuantityUtil import org.apache.pekko.util.Timeout -import java.io.File import java.nio.file.Path import java.util.Locale import scala.concurrent.duration.FiniteDuration @@ -41,7 +40,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { val successful = run(simonaSetup) - printGoodbye(successful) + printGoodbye(successful, simonaSetup.logOutputDir) // prevents cutting of the log when having a fast simulation Thread.sleep(1000) @@ -56,7 +55,10 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { ) } - private def printGoodbye(successful: Boolean): Unit = { + private def printGoodbye( + successful: Boolean, + outputPath: String = "", + ): Unit = { val myWords = Array( "\"Vielleicht ist heute ein besonders guter Tag zum Sterben.\" - Worf (in Star Trek: Der erste Kontakt)", "\"Assimiliert das!\" - Worf (in Star Trek: Der erste Kontakt)", @@ -75,14 +77,10 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { // to ensure that the link to the log is printed last Thread.sleep(1000) - val root: Path = Path.of( - new File(".").getAbsoluteFile.getParent, - "logs", - "simona", - "simona.log", - ) + val path = Path.of(outputPath).resolve("simona.log").toUri + logger.error( - s"Simulation stopped due to the occurrence of an error! The full log can be found here: $root" + s"Simulation stopped due to the occurrence of an error! The full log can be found here: $path" ) } } diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala index f96a144a36..af38bc0101 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala @@ -38,6 +38,10 @@ trait SimonaSetup { */ val args: Array[String] + /** Directory of the log output. + */ + val logOutputDir: String + /** Creates the runtime event listener * * @param context diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala index 6788a652f2..2c96bd5cd2 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala @@ -66,6 +66,7 @@ class SimonaStandaloneSetup( resultFileHierarchy: ResultFileHierarchy, runtimeEventQueue: Option[LinkedBlockingQueue[RuntimeEvent]] = None, override val args: Array[String], + override val logOutputDir: String, ) extends SimonaSetup { override def gridAgents( @@ -391,5 +392,6 @@ object SimonaStandaloneSetup extends LazyLogging with SetupHelper { resultFileHierarchy, runtimeEventQueue, mainArgs, + resultFileHierarchy.logOutputDir, ) } diff --git a/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala b/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala index c6ffda8fab..a3c1e6be02 100644 --- a/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala @@ -398,6 +398,8 @@ object SimonaSimSpec { override val args: Array[String] = Array.empty[String] + override val logOutputDir: String = "" + override def runtimeEventListener( context: ActorContext[_] ): ActorRef[RuntimeEventListener.Request] = context.spawn( diff --git a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala index d8cc467dd9..407ca5cb08 100644 --- a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala @@ -32,6 +32,8 @@ class SimonaSetupSpec extends UnitSpec with SimonaSetup with SubGridGateMokka { override val args: Array[String] = Array.empty[String] + override val logOutputDir: String = "" + override def runtimeEventListener( context: ActorContext[_] ): ActorRef[RuntimeEventListener.Request] = From 8b4538671a8d42d1127f139d23ff3fbbf06c9ec1 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 31 May 2024 08:35:36 +0200 Subject: [PATCH 08/22] spotless --- docs/readthedocs/allpages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readthedocs/allpages.md b/docs/readthedocs/allpages.md index b97e268aa3..d58cac0a20 100644 --- a/docs/readthedocs/allpages.md +++ b/docs/readthedocs/allpages.md @@ -14,4 +14,4 @@ maxdepth: 1 * !allpages -``` \ No newline at end of file +``` From 8fe1a71bc19e69d436b2bdb9858993532f431114 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Thu, 6 Jun 2024 12:29:08 +0200 Subject: [PATCH 09/22] Add possibility to flush out `Cylindrical Storage Results`. --- CHANGELOG.md | 1 + input/samples/vn_simona/vn_simona.conf | 4 + .../ie3/simona/config/ConfigFailFast.scala | 86 ++++++++++++++++--- .../edu/ie3/simona/util/ConfigUtil.scala | 11 ++- .../ie3/simona/util/EntityMapperUtil.scala | 6 +- .../simona/config/ConfigFailFastSpec.scala | 84 +++++++++++++++++- .../edu/ie3/simona/util/ConfigUtilSpec.scala | 7 +- 7 files changed, 174 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa9ff87da1..c05424bddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Consider scaling factor with flex options [#734](https://github.com/ie3-institute/simona/issues/734) - Implementation of Energy Management Agents [#204](https://github.com/ie3-institute/simona/issues/204) - Providing documentation for EmAgent protocols and algorithms [#774](https://github.com/ie3-institute/simona/issues/774) +- Option to flush out `CylindricalStorageResults` [#826](https://github.com/ie3-institute/simona/issues/826) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) diff --git a/input/samples/vn_simona/vn_simona.conf b/input/samples/vn_simona/vn_simona.conf index 401d783120..55c14f26a2 100644 --- a/input/samples/vn_simona/vn_simona.conf +++ b/input/samples/vn_simona/vn_simona.conf @@ -92,6 +92,10 @@ simona.output.thermal = { { notifier = "house", simulationResult = true + }, + { + notifier = "cylindricalstorage", + simulationResult = true } ] } diff --git a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala index df199e55c5..0eeabbf6cc 100644 --- a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala +++ b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala @@ -9,13 +9,7 @@ package edu.ie3.simona.config import com.typesafe.config.{Config, ConfigException} import com.typesafe.scalalogging.LazyLogging import edu.ie3.simona.config.SimonaConfig.Simona.Output.Sink.InfluxDb1x -import edu.ie3.simona.config.SimonaConfig.{ - BaseOutputConfig, - RefSystemConfig, - ResultKafkaParams, - Simona, - TransformerControlGroup, -} +import edu.ie3.simona.config.SimonaConfig._ import edu.ie3.simona.exceptions.InvalidConfigParameterException import edu.ie3.simona.io.result.ResultSinkType import edu.ie3.simona.model.participant.load.{LoadModelBehaviour, LoadReference} @@ -144,6 +138,11 @@ case object ConfigFailFast extends LazyLogging { simonaConfig.simona.output.participant ) + /* Check all output configurations for thermal models */ + checkThermalOutputConfig( + simonaConfig.simona.output.thermal + ) + /* Check power flow resolution configuration */ checkPowerFlowResolutionConfiguration(simonaConfig.simona.powerflow) @@ -429,8 +428,8 @@ case object ConfigFailFast extends LazyLogging { /** Sanity checks for a [[SimonaConfig.RefSystemConfig]] * - * @param refSystem - * the [[SimonaConfig.RefSystemConfig]] that should be checked + * @param refSystems + * a list of [[SimonaConfig.RefSystemConfig]]s that should be checked */ private def checkRefSystem(refSystems: List[RefSystemConfig]): Unit = { @@ -563,6 +562,21 @@ case object ConfigFailFast extends LazyLogging { checkIndividualParticipantsOutputConfigs(subConfig.individualConfigs) } + /** Check the config sub tree for output parameterization + * + * @param subConfig + * Output sub config tree for participants + */ + private def checkThermalOutputConfig( + subConfig: SimonaConfig.Simona.Output.Thermal + ): Unit = { + checkDefaultBaseOutputConfig( + subConfig.defaultConfig, + defaultString = "default", + ) + checkIndividualThermalOutputConfigs(subConfig.individualConfigs) + } + /** Checks resolution of power flow calculation * * @param powerFlow @@ -690,6 +704,34 @@ case object ConfigFailFast extends LazyLogging { s"There are multiple output configurations for participant types '${duplicateKeys.mkString(",")}'." ) + implicit val participantNotifiers: Set[NotifierIdentifier.Value] = + NotifierIdentifier.getParticipantIdentifiers + configs.foreach(checkBaseOutputConfig) + } + + /** Checks the thermal output configurations on duplicates + * + * @param configs + * List of individual config entries + */ + private def checkIndividualThermalOutputConfigs( + configs: List[SimonaConfig.BaseOutputConfig] + ): Unit = { + val duplicateKeys = configs + .map(config => StringUtils.cleanString(config.notifier).toLowerCase()) + .groupMapReduce(identity)(_ => 1)(_ + _) + .filter { case (_, count) => + count > 1 + } + .keys + + if (duplicateKeys.nonEmpty) + throw new InvalidConfigParameterException( + s"There are multiple output configurations for participant types '${duplicateKeys.mkString(",")}'." + ) + + implicit val thermalNotifiers: Set[NotifierIdentifier.Value] = + NotifierIdentifier.getThermalIdentifiers configs.foreach(checkBaseOutputConfig) } @@ -697,23 +739,39 @@ case object ConfigFailFast extends LazyLogging { * * @param config * to be checked + * @param exceptedNotifiers + * a set of all valid identifiers */ - private def checkBaseOutputConfig(config: BaseOutputConfig): Unit = { - checkNotifierIdentifier(config.notifier) + private def checkBaseOutputConfig( + config: BaseOutputConfig + )(implicit exceptedNotifiers: Set[NotifierIdentifier.Value]): Unit = { + checkNotifierIdentifier(config.notifier, exceptedNotifiers) } /** Check the validity of the identifier String * * @param id * identifier String to check + * @param exceptedNotifiers + * a set of all valid identifiers */ - private def checkNotifierIdentifier(id: String): Unit = { + private def checkNotifierIdentifier( + id: String, + exceptedNotifiers: Set[NotifierIdentifier.Value], + ): Unit = { try { - NotifierIdentifier(id) + val notifier = NotifierIdentifier(id) + + if (!exceptedNotifiers.contains(notifier)) { + throw new InvalidConfigParameterException( + s"The identifier '$id' you provided is not valid. Valid input: ${exceptedNotifiers.map(_.toString).mkString(",")}" + ) + } + } catch { case e: NoSuchElementException => throw new InvalidConfigParameterException( - s"The identifier '$id' you provided is not valid. Valid input: ${NotifierIdentifier.values.map(_.toString).mkString(",")}", + s"The identifier '$id' you provided is not valid. Valid input: ${exceptedNotifiers.map(_.toString).mkString(",")}", e, ) } diff --git a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala index b041129c90..d9fd6ee24f 100644 --- a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala @@ -148,8 +148,7 @@ object ConfigUtil { if (defaultConfig.simulationResultInfo) { val notifiers = if (thermal) NotifierIdentifier.getThermalIdentifiers - else - NotifierIdentifier.values -- NotifierIdentifier.getThermalIdentifiers + else NotifierIdentifier.getParticipantIdentifiers /* Generally inform about all simulation results, but not on those, that are explicitly marked */ notifiers -- configs.flatMap { case ( @@ -292,10 +291,16 @@ object ConfigUtil { val Wec: Value = Value("wec") val Hp: Value = Value("hp") val House: Value = Value("house") + val CylindricalStorage: Value = Value("cylindricalstorage") + + /** All participant identifiers */ + def getParticipantIdentifiers: Set[Value] = + (NotifierIdentifier.values -- getThermalIdentifiers).toSet /** All thermal identifiers */ def getThermalIdentifiers: Set[Value] = Set( - NotifierIdentifier.House + NotifierIdentifier.House, + NotifierIdentifier.CylindricalStorage, ) } diff --git a/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala b/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala index ed9192dcb1..3308813320 100644 --- a/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala @@ -8,7 +8,10 @@ package edu.ie3.simona.util import edu.ie3.datamodel.models.result.ResultEntity import edu.ie3.datamodel.models.result.system._ -import edu.ie3.datamodel.models.result.thermal.ThermalHouseResult +import edu.ie3.datamodel.models.result.thermal.{ + CylindricalStorageResult, + ThermalHouseResult, +} import edu.ie3.simona.util.ConfigUtil.NotifierIdentifier import edu.ie3.simona.util.ConfigUtil.NotifierIdentifier._ @@ -27,6 +30,7 @@ object EntityMapperUtil { Em -> classOf[EmResult], Hp -> classOf[HpResult], House -> classOf[ThermalHouseResult], + CylindricalStorage -> classOf[CylindricalStorageResult], ) /** Get the classes of [[ResultEntity]], that are issued by the notifier, that diff --git a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala index 227d8f05cf..77d59d7dfa 100644 --- a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala +++ b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala @@ -680,15 +680,19 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { "identify faulty notifier identifiers" in { intercept[InvalidConfigParameterException] { - ConfigFailFast invokePrivate checkNotifierIdentifier("whatever") - }.getMessage shouldBe s"The identifier 'whatever' you provided is not valid. Valid input: ${NotifierIdentifier.values.map(_.toString).mkString(",")}" + ConfigFailFast invokePrivate checkNotifierIdentifier( + "whatever", + NotifierIdentifier.getParticipantIdentifiers, + ) + }.getMessage shouldBe s"The identifier 'whatever' you provided is not valid. Valid input: ${NotifierIdentifier.getParticipantIdentifiers.map(_.toString).mkString(",")}" } "let all valid notifier identifiers pass" in { noException shouldBe thrownBy { - NotifierIdentifier.values.map(id => + NotifierIdentifier.getParticipantIdentifiers.map(id => ConfigFailFast invokePrivate checkNotifierIdentifier( - id.toString + id.toString, + NotifierIdentifier.getParticipantIdentifiers, ) ) } @@ -758,6 +762,78 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { } } + "Checking thermal output configs" should { + val checkNotifierIdentifier = + PrivateMethod[Unit](Symbol("checkNotifierIdentifier")) + + "identify faulty notifier identifiers" in { + intercept[InvalidConfigParameterException] { + ConfigFailFast invokePrivate checkNotifierIdentifier( + "whatever", + NotifierIdentifier.getThermalIdentifiers, + ) + }.getMessage shouldBe s"The identifier 'whatever' you provided is not valid. Valid input: ${NotifierIdentifier.getThermalIdentifiers.map(_.toString).mkString(",")}" + } + + "let all valid notifier identifiers pass" in { + noException shouldBe thrownBy { + Set("house", "cylindricalstorage").map(id => + ConfigFailFast invokePrivate checkNotifierIdentifier( + id, + NotifierIdentifier.getThermalIdentifiers, + ) + ) + } + } + + val checkIndividualThermalOutputConfigs = + PrivateMethod[Unit]( + Symbol("checkIndividualThermalOutputConfigs") + ) + + "let distinct configs pass" in { + val validInput = List( + SimonaConfig.SimpleOutputConfig( + notifier = "house", + simulationResult = false, + ), + SimonaConfig.SimpleOutputConfig( + notifier = "cylindricalstorage", + simulationResult = false, + ), + ) + + noException shouldBe thrownBy { + ConfigFailFast invokePrivate checkIndividualThermalOutputConfigs( + validInput + ) + } + } + + "throw an exception, when there is a duplicate entry for the same model type" in { + val invalidInput = List( + SimonaConfig.SimpleOutputConfig( + notifier = "house", + simulationResult = false, + ), + SimonaConfig.SimpleOutputConfig( + notifier = "cylindricalstorage", + simulationResult = false, + ), + SimonaConfig.SimpleOutputConfig( + notifier = "house", + simulationResult = false, + ), + ) + + intercept[InvalidConfigParameterException]( + ConfigFailFast invokePrivate checkIndividualThermalOutputConfigs( + invalidInput + ) + ).getMessage shouldBe "There are multiple output configurations for participant types 'house'." + } + } + "Checking data sinks" should { val checkDataSink = PrivateMethod[Unit](Symbol("checkDataSink")) diff --git a/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala b/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala index 1356fef9cb..56d478d3cf 100644 --- a/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala +++ b/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala @@ -721,9 +721,10 @@ class ConfigUtilSpec ), ) val configUtil = OutputConfigUtil(inputConfig) - val expectedResult: Set[Value] = NotifierIdentifier.values -- Vector( - NotifierIdentifier.PvPlant - ) -- NotifierIdentifier.getThermalIdentifiers.toVector + val expectedResult: Set[Value] = + NotifierIdentifier.getParticipantIdentifiers -- Vector( + NotifierIdentifier.PvPlant + ) configUtil.simulationResultIdentifiersToConsider( false From 52529c416659bd4dd586788f1fff9868ee4b91b6 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Thu, 6 Jun 2024 12:34:23 +0200 Subject: [PATCH 10/22] Enhancing the config documentation. --- docs/readthedocs/config.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/readthedocs/config.md b/docs/readthedocs/config.md index f964378c67..73004b387c 100644 --- a/docs/readthedocs/config.md +++ b/docs/readthedocs/config.md @@ -147,6 +147,33 @@ simona.output.participant.individualConfigs = [ ] ``` +#### Output configuration of thermal elements + +To use the default configuration the default notifier has to be used. By setting "simulationResult" to true, the thermal elements is enabled to return its results. + +``` +simona.output.thermal.defaultConfig = { + notifier = "default", + simulationResult = true +} +``` + +The default configuration applies to all models except the ones with individual configurations assigned. +If individual configurations have to be performed for certain thermal elements, these must be listed with the corresponding notifier as in the following example. + +``` +simona.output.thermal.individualConfigs = [ + { + notifier = "house", + simulationResult = true + }, + { + notifier = "cylindricalstorage", + simulationResult = true + } +] +``` + Further model classes which can be used to load the outcome of a system simulation are described in [PSDM](https://powersystemdatamodel.readthedocs.io/en/latest/models/models.html#result). Data sources and data sinks are explained in the [I/O-capabilities](https://powersystemdatamodel.readthedocs.io/en/latest/io/basiciousage.html) section of the PSDM. From 8c06effdc93bf930b7654f04c561431c608faa19 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Thu, 6 Jun 2024 17:10:31 +0200 Subject: [PATCH 11/22] Abstracting some methods in `ConfigFailFast`. --- .../ie3/simona/config/ConfigFailFast.scala | 67 +++++++------------ .../simona/config/ConfigFailFastSpec.scala | 30 +++++---- 2 files changed, 41 insertions(+), 56 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala index 0eeabbf6cc..f324f35678 100644 --- a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala +++ b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala @@ -555,11 +555,10 @@ case object ConfigFailFast extends LazyLogging { ) ) - checkDefaultBaseOutputConfig( - subConfig.defaultConfig, - defaultString = "default", - ) - checkIndividualParticipantsOutputConfigs(subConfig.individualConfigs) + implicit val elementType: String = "participant" + + checkDefaultBaseOutputConfig(subConfig.defaultConfig) + checkIndividualOutputConfigs(subConfig.individualConfigs) } /** Check the config sub tree for output parameterization @@ -570,11 +569,9 @@ case object ConfigFailFast extends LazyLogging { private def checkThermalOutputConfig( subConfig: SimonaConfig.Simona.Output.Thermal ): Unit = { - checkDefaultBaseOutputConfig( - subConfig.defaultConfig, - defaultString = "default", - ) - checkIndividualThermalOutputConfigs(subConfig.individualConfigs) + implicit val elementType: String = "thermal" + checkDefaultBaseOutputConfig(subConfig.defaultConfig) + checkIndividualOutputConfigs(subConfig.individualConfigs) } /** Checks resolution of power flow calculation @@ -671,26 +668,26 @@ case object ConfigFailFast extends LazyLogging { */ private def checkDefaultBaseOutputConfig( config: SimonaConfig.BaseOutputConfig, - defaultString: String, - ): Unit = { + defaultString: String = "default", + )(implicit elementType: String): Unit = { if ( StringUtils .cleanString(config.notifier) .toLowerCase != StringUtils.cleanString(defaultString).toLowerCase ) logger.warn( - s"You provided '${config.notifier}' as model type for the default participant output config. This will not be considered!" + s"You provided '${config.notifier}' as model type for the default $elementType output config. This will not be considered!" ) } - /** Checks the participant output configurations on duplicates + /** Checks the given output configurations on duplicates * * @param configs * List of individual config entries */ - private def checkIndividualParticipantsOutputConfigs( + private def checkIndividualOutputConfigs( configs: List[SimonaConfig.BaseOutputConfig] - ): Unit = { + )(implicit elementType: String): Unit = { val duplicateKeys = configs .map(config => StringUtils.cleanString(config.notifier).toLowerCase()) .groupMapReduce(identity)(_ => 1)(_ + _) @@ -701,37 +698,21 @@ case object ConfigFailFast extends LazyLogging { if (duplicateKeys.nonEmpty) throw new InvalidConfigParameterException( - s"There are multiple output configurations for participant types '${duplicateKeys.mkString(",")}'." + s"There are multiple output configurations for $elementType types '${duplicateKeys.mkString(",")}'." ) - implicit val participantNotifiers: Set[NotifierIdentifier.Value] = - NotifierIdentifier.getParticipantIdentifiers - configs.foreach(checkBaseOutputConfig) - } - - /** Checks the thermal output configurations on duplicates - * - * @param configs - * List of individual config entries - */ - private def checkIndividualThermalOutputConfigs( - configs: List[SimonaConfig.BaseOutputConfig] - ): Unit = { - val duplicateKeys = configs - .map(config => StringUtils.cleanString(config.notifier).toLowerCase()) - .groupMapReduce(identity)(_ => 1)(_ + _) - .filter { case (_, count) => - count > 1 + implicit val exceptedNotifiers: Set[NotifierIdentifier.Value] = + elementType match { + case "participant" => + NotifierIdentifier.getParticipantIdentifiers + case "thermal" => + NotifierIdentifier.getThermalIdentifiers + case other => + throw new InvalidConfigParameterException( + s"The output config for $other has no notifiers!" + ) } - .keys - - if (duplicateKeys.nonEmpty) - throw new InvalidConfigParameterException( - s"There are multiple output configurations for participant types '${duplicateKeys.mkString(",")}'." - ) - implicit val thermalNotifiers: Set[NotifierIdentifier.Value] = - NotifierIdentifier.getThermalIdentifiers configs.foreach(checkBaseOutputConfig) } diff --git a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala index 77d59d7dfa..b6ed1e1625 100644 --- a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala +++ b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala @@ -698,9 +698,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { } } - val checkIndividualParticipantsOutputConfigs = + val checkIndividualOutputConfigs = PrivateMethod[Unit]( - Symbol("checkIndividualParticipantsOutputConfigs") + Symbol("checkIndividualOutputConfigs") ) "let distinct configs pass" in { @@ -726,8 +726,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ) noException shouldBe thrownBy { - ConfigFailFast invokePrivate checkIndividualParticipantsOutputConfigs( - validInput + ConfigFailFast invokePrivate checkIndividualOutputConfigs( + validInput, + "participant", ) } } @@ -755,8 +756,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ) intercept[InvalidConfigParameterException]( - ConfigFailFast invokePrivate checkIndividualParticipantsOutputConfigs( - invalidInput + ConfigFailFast invokePrivate checkIndividualOutputConfigs( + invalidInput, + "participant", ) ).getMessage shouldBe "There are multiple output configurations for participant types 'load'." } @@ -786,9 +788,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { } } - val checkIndividualThermalOutputConfigs = + val checkIndividualOutputConfigs = PrivateMethod[Unit]( - Symbol("checkIndividualThermalOutputConfigs") + Symbol("checkIndividualOutputConfigs") ) "let distinct configs pass" in { @@ -804,8 +806,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ) noException shouldBe thrownBy { - ConfigFailFast invokePrivate checkIndividualThermalOutputConfigs( - validInput + ConfigFailFast invokePrivate checkIndividualOutputConfigs( + validInput, + "thermal", ) } } @@ -827,10 +830,11 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ) intercept[InvalidConfigParameterException]( - ConfigFailFast invokePrivate checkIndividualThermalOutputConfigs( - invalidInput + ConfigFailFast invokePrivate checkIndividualOutputConfigs( + invalidInput, + "thermal", ) - ).getMessage shouldBe "There are multiple output configurations for participant types 'house'." + ).getMessage shouldBe "There are multiple output configurations for thermal types 'house'." } } From 4693145abb08a7c87773a6b93c4f0ff45b72cc49 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Mon, 24 Jun 2024 08:44:51 +0200 Subject: [PATCH 12/22] Implementing requested changes. --- .../edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala index 37c42e8ed0..0a3eb13e08 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala @@ -66,7 +66,8 @@ class SimonaStandaloneSetup( resultFileHierarchy: ResultFileHierarchy, runtimeEventQueue: Option[LinkedBlockingQueue[RuntimeEvent]] = None, override val args: Array[String], - override val logOutputDir: String, +)( + override val logOutputDir: String = resultFileHierarchy.logOutputDir ) extends SimonaSetup { override def gridAgents( @@ -392,6 +393,5 @@ object SimonaStandaloneSetup extends LazyLogging with SetupHelper { resultFileHierarchy, runtimeEventQueue, mainArgs, - resultFileHierarchy.logOutputDir, - ) + )() } From 4eadaf81d172567673aa80c55f11561d215897c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:23:58 +0000 Subject: [PATCH 13/22] Bump org.scalatest:scalatest_2.13 from 3.2.18 to 3.2.19 (#833) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c18367c433..e7fdf21625 100644 --- a/build.gradle +++ b/build.gradle @@ -103,7 +103,7 @@ dependencies { 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.scalatest:scalatest_${scalaVersion}:3.2.18" + 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' testImplementation "org.apache.pekko:pekko-testkit_${scalaVersion}:${pekkoVersion}" // pekko testkit From 00b96a490a3a00bf399077caf1cc6fdf2f9e867e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:42:15 +0000 Subject: [PATCH 14/22] Bump testContainerVersion from 0.41.3 to 0.41.4 (#830) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e7fdf21625..25a1d22448 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ ext { tscfgVersion = '1.0.0' scapegoatVersion = '2.1.6' - testContainerVersion = '0.41.3' + testContainerVersion = '0.41.4' scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator // location of script plugins } From 4c98a0837821cc26fe907e28810c5dc117daa369 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Tue, 25 Jun 2024 11:29:09 +0200 Subject: [PATCH 15/22] Updating to PSDM version 5.1.0 --- CHANGELOG.md | 1 + build.gradle | 2 +- .../simona/service/weather/SampleWeatherSource.scala | 12 ++++++++++++ .../simona/service/weather/WeatherSourceSpec.scala | 12 ++++++++++++ .../service/weather/WeatherSourceWrapperSpec.scala | 4 +--- .../simona/test/common/input/EmInputTestData.scala | 3 --- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05424bddc..503802b799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactoring of `GridAgent` messages [#736](https://github.com/ie3-institute/simona/issues/736) - 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) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/build.gradle b/build.gradle index c18367c433..68ca2f3287 100644 --- a/build.gradle +++ b/build.gradle @@ -75,7 +75,7 @@ dependencies { /* Exclude our own nested dependencies */ exclude group: 'com.github.ie3-institute' } - implementation('com.github.ie3-institute:PowerSystemDataModel:5.0.1') { + implementation('com.github.ie3-institute:PowerSystemDataModel:5.1.0') { exclude group: 'org.apache.logging.log4j' exclude group: 'org.slf4j' /* Exclude our own nested dependencies */ diff --git a/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala b/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala index 5788aca327..37a5cd8fa9 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala @@ -168,6 +168,18 @@ object SampleWeatherSource { else Vector.empty[CoordinateDistance].asJava } + + override def findCornerPoints( + point: Point, + distance: ComparableQuantity[Length], + ): util.List[CoordinateDistance] = { + // just a dummy implementation, because this is just a sample weather source + getClosestCoordinates(point, 4, distance) + } + + override def validate(): Unit = { + /* nothing to do here */ + } } // these lists contain the hourly weather values for each first of the month of 2011 + january of diff --git a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala index 2da8e6c63e..aa6fd74bc6 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala @@ -450,5 +450,17 @@ case object WeatherSourceSpec { ): util.List[CoordinateDistance] = { calculateCoordinateDistances(coordinate, n, coordinateToId.keySet.asJava) } + + override def findCornerPoints( + point: Point, + distance: ComparableQuantity[Length], + ): util.List[CoordinateDistance] = { + // just a dummy implementation + getClosestCoordinates(point, 4, distance) + } + + override def validate(): Unit = { + /* nothing to do here */ + } } } diff --git a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala index ab00e32bdf..fcad677f91 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala @@ -318,9 +318,7 @@ object WeatherSourceWrapperSpec { ), ) - override def getSourceFields[C <: WeatherValue]( - entityClass: Class[C] - ): Optional[util.Set[String]] = + override def getSourceFields: Optional[util.Set[String]] = // only required for validation Optional.empty diff --git a/src/test/scala/edu/ie3/simona/test/common/input/EmInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/EmInputTestData.scala index 4c349c603e..7eeb67574c 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/EmInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/EmInputTestData.scala @@ -78,9 +78,6 @@ trait EmInputTestData Quantities.getQuantity(5d, KILOWATT), Quantities.getQuantity(0.03, PU_PER_HOUR), Quantities.getQuantity(0.95, PU), - Quantities.getQuantity(20d, PERCENT), - Quantities.getQuantity(50000d, HOUR), - 100000, ) protected val householdStorageInput = new StorageInput( From 97f5daeba72a0ef501ae0c0df3bbbeb8d4b8691d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 06:51:32 +0000 Subject: [PATCH 16/22] Bump org.scoverage from 8.0.3 to 8.1 (#837) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 25a1d22448..eb68f80d8b 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ plugins { 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.0.0.4638" // sonarqube - id "org.scoverage" version "8.0.3" // scala code coverage scoverage + 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' id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning From de45c968d7e0eebfa454b881d9259128dbbc4e61 Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Wed, 26 Jun 2024 16:49:32 +0200 Subject: [PATCH 17/22] Defined logOutputDir as method, not value Signed-off-by: Sebastian Peter --- src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala | 2 +- .../edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala | 6 +++--- src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala | 2 +- .../scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala index 8809c4ea6b..bfb4e16cee 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala @@ -40,7 +40,7 @@ trait SimonaSetup { /** Directory of the log output. */ - val logOutputDir: String + def logOutputDir: String /** Creates the runtime event listener * diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala index 0a3eb13e08..32711a4a3d 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala @@ -66,10 +66,10 @@ class SimonaStandaloneSetup( resultFileHierarchy: ResultFileHierarchy, runtimeEventQueue: Option[LinkedBlockingQueue[RuntimeEvent]] = None, override val args: Array[String], -)( - override val logOutputDir: String = resultFileHierarchy.logOutputDir ) extends SimonaSetup { + override def logOutputDir: String = resultFileHierarchy.logOutputDir + override def gridAgents( context: ActorContext[_], environmentRefs: EnvironmentRefs, @@ -393,5 +393,5 @@ object SimonaStandaloneSetup extends LazyLogging with SetupHelper { resultFileHierarchy, runtimeEventQueue, mainArgs, - )() + ) } diff --git a/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala b/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala index be2ecac3d3..ad028070d2 100644 --- a/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/SimonaSimSpec.scala @@ -398,7 +398,7 @@ object SimonaSimSpec { override val args: Array[String] = Array.empty[String] - override val logOutputDir: String = "" + override def logOutputDir: String = throw new NotImplementedError() override def runtimeEventListener( context: ActorContext[_] diff --git a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala index ba62417007..55e7310266 100644 --- a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala @@ -32,7 +32,7 @@ class SimonaSetupSpec extends UnitSpec with SimonaSetup with SubGridGateMokka { override val args: Array[String] = Array.empty[String] - override val logOutputDir: String = "" + override def logOutputDir: String = throw new NotImplementedError() override def runtimeEventListener( context: ActorContext[_] From 16e874e4dac0d095c75c61549f1cb80c5f7a2dc8 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 26 Jun 2024 17:19:42 +0200 Subject: [PATCH 18/22] Delete "Indices and tables" on the index page --- CHANGELOG.md | 1 + docs/readthedocs/allpages.md | 17 ----------------- docs/readthedocs/conf.py | 2 +- docs/readthedocs/index.rst | 9 +-------- 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 docs/readthedocs/allpages.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a008103c1d..52efa60e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Default RefSystem using the unit `Volt` for low voltage grids [#811](https://github.com/ie3-institute/simona/issues/811) - Fixed grid within GridSpec test [#806](https://github.com/ie3-institute/simona/issues/806) - Fixed log entry after power flow calculation [#814](https://github.com/ie3-institute/simona/issues/814) +- Delete "Indices and tables" on the index page [#375](https://github.com/ie3-institute/simona/issues/375) ## [3.0.0] - 2023-08-07 diff --git a/docs/readthedocs/allpages.md b/docs/readthedocs/allpages.md deleted file mode 100644 index d58cac0a20..0000000000 --- a/docs/readthedocs/allpages.md +++ /dev/null @@ -1,17 +0,0 @@ -(allpages)= - -# All Pages - -Here are all available pages listed: - -```{toctree} ---- -maxdepth: 1 ---- -.. toctree:: - :maxdepth: 2 - :glob: - - * - !allpages -``` diff --git a/docs/readthedocs/conf.py b/docs/readthedocs/conf.py index e78a262a87..16f145a060 100644 --- a/docs/readthedocs/conf.py +++ b/docs/readthedocs/conf.py @@ -37,7 +37,7 @@ html_theme = 'sphinx_rtd_theme' html_short_title = "simona" htmlhelp_basename = 'simona-doc' -html_use_index = True +html_use_index = False html_show_sourcelink = False html_static_path = ['_static'] diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 1360094243..03fb56bbb2 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -18,11 +18,4 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu models developersguide references - allpages - -Indices and tables -================== - -For more information, please visit the :doc:`All Pages ` page. - - + index \ No newline at end of file From 52667804871d2ecc9279b656ae4c02513aff5cb1 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 26 Jun 2024 17:23:58 +0200 Subject: [PATCH 19/22] fmt --- docs/readthedocs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index 03fb56bbb2..e9029962ab 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -17,5 +17,4 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu config models developersguide - references - index \ No newline at end of file + references \ No newline at end of file From 95a9c5fd8676f7c9e8120eba9663cfb11949c911 Mon Sep 17 00:00:00 2001 From: pierrepetersmeier Date: Wed, 26 Jun 2024 17:37:26 +0200 Subject: [PATCH 20/22] fmt --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05424bddc..f684989eea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Default RefSystem using the unit `Volt` for low voltage grids [#811](https://github.com/ie3-institute/simona/issues/811) - Fixed grid within GridSpec test [#806](https://github.com/ie3-institute/simona/issues/806) - Fixed log entry after power flow calculation [#814](https://github.com/ie3-institute/simona/issues/814) +- Delete "Indices and tables" on the index page [#375](https://github.com/ie3-institute/simona/issues/375) ## [3.0.0] - 2023-08-07 From a3000b3f50348277d704e1caf871c27b47256b84 Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Thu, 27 Jun 2024 09:32:59 +0200 Subject: [PATCH 21/22] Reverting merge slips --- CHANGELOG.md | 1 + docs/readthedocs/conf.py | 1 + docs/readthedocs/index.rst | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f684989eea..6de5f04b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactoring of `GridAgent` messages [#736](https://github.com/ie3-institute/simona/issues/736) - 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) ### 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/conf.py b/docs/readthedocs/conf.py index 16f145a060..6ec36e73ef 100644 --- a/docs/readthedocs/conf.py +++ b/docs/readthedocs/conf.py @@ -44,6 +44,7 @@ # PlantUML options plantuml = 'plantuml' + # Intersphinx for references to external ReadTheDocs intersphinx_mapping = { 'psdm': ('https://powersystemdatamodel.readthedocs.io/en/latest/', None), diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.rst index e9029962ab..5ad7bc0ffd 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.rst @@ -17,4 +17,4 @@ Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmu config models developersguide - references \ No newline at end of file + references From 9a4b0eb75c005ac2bc64d10f78799d51e9585d88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:08:46 +0000 Subject: [PATCH 22/22] Bump org.apache.poi:poi-ooxml from 5.2.5 to 5.3.0 (#843) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 17d5a8694e..84357015f7 100644 --- a/build.gradle +++ b/build.gradle @@ -145,7 +145,7 @@ dependencies { implementation "com.sksamuel.avro4s:avro4s-core_${scalaVersion}:4.1.2" implementation 'org.apache.commons:commons-math3:3.6.1' // apache commons math3 - implementation 'org.apache.poi:poi-ooxml:5.2.5' // used for FilenameUtils + 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 "org.typelevel:squants_${scalaVersion}:1.8.3"