From ab5b11a0135f12a98a3d9790bc4aba32f203aacb Mon Sep 17 00:00:00 2001 From: Julian Straus Date: Tue, 16 Dec 2025 08:24:04 +0100 Subject: [PATCH 1/3] Updated docs and README.md --- NEWS.md | 4 ++++ README.md | 8 -------- docs/src/manual/quick-start.md | 4 ---- docs/src/manual/use.md | 14 ++++++++++++++ test/test_emb_mwe.jl | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/NEWS.md b/NEWS.md index 12724b4..e764a3a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # Release notes +## Unversioned + +* Minor updates to `README.md` and the documentation. + ## Version 0.1.0 (2025-03-27) Initial version of the package: diff --git a/README.md b/README.md index bb0dbed..82b9b3a 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,6 @@ While it can be used as a first step for checking new elements, thorough tests o The usage of the package is best illustrated through the commented [`examples`](examples). The examples showcase how the functions from `EnergyModelsCompliance` can be utilized to identify whether your newly developed element can be incorporated in `EnergyModelsBase` or `EnergyModelsGeography` models. -> [!WARNING] -> The package is not yet registered. -> It is hence necessary to first clone the package and manually add the package to the example environment through: -> -> ```julia -> ] dev .. -> ``` - ## Cite If you find `EnergyModelsCompliance` useful in your work, we kindly request that you cite the following [publication](https://doi.org/10.21105/joss.06619): diff --git a/docs/src/manual/quick-start.md b/docs/src/manual/quick-start.md index 306aedd..0ab2948 100644 --- a/docs/src/manual/quick-start.md +++ b/docs/src/manual/quick-start.md @@ -8,7 +8,3 @@ > ] add TimeStruct > ] add EnergyModelsCompliance > ``` - -!!! note - If you receive the error that `EnergyModelsCompliance` is not yet registered, you have to add the package using the GitHub repositories through `] add https://github.com/EnergyModelsX/EnergyModelsCompliance.jl`. - Once the package is registered, this is not required. diff --git a/docs/src/manual/use.md b/docs/src/manual/use.md index fa5fa0b..a62dde0 100644 --- a/docs/src/manual/use.md +++ b/docs/src/manual/use.md @@ -37,6 +37,20 @@ It should be used for identifying whether the developed element results in a tri The function creates a minimum working example given an instance of the element, a simple time structure, and the `warn_log` from the function [`compliance_element`](@ref). It then tests whether the new element is utilized. +!!! note "Tested values" + The utilization is tested by the variable `:cap_use` of the connected `Node`s and a corresponding utilization value of the new `Node` or `TransmissionMode`. + It must be above 0.1 in at least one of the time periods for all connected `Node`s. + The tests for the node itself are: + - `:cap_use` of the developed `Node` is larger than 0.1 at least once. + - `:stor_level` of the developed `Storage` is larger than 0.1 at least once. + `:stor_charge_use` an/or `stor_discharge_use` must also be above 0.1 at least once depending on whether the `Storage` node has input or output. + - `:trans_in` and `:trans_out` of the developed `TransmissionMode` is larger than 0.1 at least once. + + You must adjust your test case that they are working with these test values. + + This is also explained in the respective docstrings [`test_case(n::Source, 𝒯::TimeStructure, warn; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))`](@ref) and [`test_case(tm::TransmissionMode, 𝒯::TimeStructure, warn; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))`](@ref). +. + There are however a few important caveats when using the function for `Node`s. 1. If your node includes CO₂ capture or process emissions, you **must** specify the keyword argument `co2` with your CO₂ instance. diff --git a/test/test_emb_mwe.jl b/test/test_emb_mwe.jl index b37f609..f1d91ea 100644 --- a/test/test_emb_mwe.jl +++ b/test/test_emb_mwe.jl @@ -35,7 +35,7 @@ end Dict(power => 1, co2 => 1), # Output from the node with output ratio # Line above: co2 is required as output for variable definition, but the # value does not matter - [CaptureEnergyEmissions(0.9)], # Additonal data for emissions and CO₂ capture + [CaptureEnergyEmissions(0.9)], # Additional data for emissions and CO₂ capture ) err_log, warn_log = compliance_element(node); 𝒯 = TwoLevel(1,1,SimpleTimes(10,1)) From dbb1cf2f0e2aa99acceb4dc3a22934e38abdf4af Mon Sep 17 00:00:00 2001 From: Julian Straus Date: Tue, 16 Dec 2025 12:48:18 +0100 Subject: [PATCH 2/3] Deactivated tests --- NEWS.md | 3 ++- Project.toml | 2 +- README.md | 4 ++++ ext/EMGExt/compliance_ele.jl | 7 ++++++- test/test_emg_access_fun.jl | 14 +++++++------- test/test_emg_element.jl | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/NEWS.md b/NEWS.md index e764a3a..ee4e211 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,9 @@ # Release notes -## Unversioned +## Version 0.1.1 (2025-12-16) * Minor updates to `README.md` and the documentation. +* Removal of data compliance of `TransmissionMode` due to the changes from [`EnergyModelsBase` v0.9.1](https://github.com/EnergyModelsX/EnergyModelsBase.jl/releases/tag/v0.9.1) and the corresponding adjustment in [`EnergyModelsGeography` v0.11.3](https://github.com/EnergyModelsX/EnergyModelsGeography.jl/releases/tag/v0.11.3). ## Version 0.1.0 (2025-03-27) diff --git a/Project.toml b/Project.toml index 77c0697..b5de667 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "EnergyModelsCompliance" uuid = "a12c78df-351d-47be-9a81-17a33aab13b1" authors = ["Julian Straus "] -version = "0.1.0" +version = "0.1.1" [deps] EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50" diff --git a/README.md b/README.md index 82b9b3a..68963e1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ While it can be used as a first step for checking new elements, thorough tests o The usage of the package is best illustrated through the commented [`examples`](examples). The examples showcase how the functions from `EnergyModelsCompliance` can be utilized to identify whether your newly developed element can be incorporated in `EnergyModelsBase` or `EnergyModelsGeography` models. +> [!IMPORTANT] +> The reimplementation of the `ExtensionData` in [`EnergyModelsBase` v0.9.1](https://github.com/EnergyModelsX/EnergyModelsBase.jl/releases/tag/v0.9.1) and the corresponding adjustment in [`EnergyModelsGeography` v0.11.3](https://github.com/EnergyModelsX/EnergyModelsGeography.jl/releases/tag/v0.11.3) resulted in problems for checking the function `mode_data`. +> The check is hence deactivated while we consider how to do properly assess it in `EnergyModelsBase` and `EnergyModelsGeography`. + ## Cite If you find `EnergyModelsCompliance` useful in your work, we kindly request that you cite the following [publication](https://doi.org/10.21105/joss.06619): diff --git a/ext/EMGExt/compliance_ele.jl b/ext/EMGExt/compliance_ele.jl index 4d055ad..f09a32f 100644 --- a/ext/EMGExt/compliance_ele.jl +++ b/ext/EMGExt/compliance_ele.jl @@ -20,6 +20,10 @@ the indivdiual test functions. The called test functions are dependent on the ch - [`compliance_con_rate`](@ref) for [`PipeMode`](@extref EnergyModelsGeography.PipeMode), and - [`compliance_bidirectional`](@ref). + !!! warning + [`EMC.compliance_data`](@ref) is in the current stage removed as changes to the + handling of `ExtensionData`. + !!! note "Areas" The following function is called: @@ -36,7 +40,8 @@ function EMC.compliance_element(tm::TransmissionMode) warn_opex_fixed = has_opex(tm) ? EMC.compliance_opex_fixed(tm) : false err_in, warn_in = EMC.compliance_inputs(tm) err_out, warn_out = EMC.compliance_outputs(tm) - warn_data = EMC.compliance_data(tm) + # warn_data = EMC.compliance_data(tm) + warn_data = false warn_loss = compliance_loss(tm) warn_con_rate = compliance_con_rate(tm) diff --git a/test/test_emg_access_fun.jl b/test/test_emg_access_fun.jl index ed93fe5..6622645 100644 --- a/test/test_emg_access_fun.jl +++ b/test/test_emg_access_fun.jl @@ -102,13 +102,13 @@ end disable_logging(Error), (@test EMC.compliance_outputs(mode)[1]), disable_logging(Debug) Base.delete_method(@which outputs(mode)) - # Test the data warning - msg = "The function `mode_data(tm)` is not working for the mode type `TestMode`.\n" * - "If you do not use the default functions `create_mode` and `investment_data` " * - "(when using `EnergyModelsInvestments`),\n" * - "you can ignore this warning." - @test_logs (:warn, msg) EMC.compliance_data(mode) - disable_logging(Warn), (@test EMC.compliance_data(mode)), disable_logging(Debug) + # # Test the data warning + # msg = "The function `mode_data(tm)` is not working for the mode type `TestMode`.\n" * + # "If you do not use the default functions `create_mode` and `investment_data` " * + # "(when using `EnergyModelsInvestments`),\n" * + # "you can ignore this warning." + # @test_logs (:warn, msg) EMC.compliance_data(mode) + # disable_logging(Warn), (@test EMC.compliance_data(mode)), disable_logging(Debug) # Test the loss warnings msg = "The function `loss(tm)` is not working for the mode type " * diff --git a/test/test_emg_element.jl b/test/test_emg_element.jl index c58ebab..c174d42 100644 --- a/test/test_emg_element.jl +++ b/test/test_emg_element.jl @@ -21,7 +21,7 @@ end @test all(err_log == (inputs=true, outputs=true, bidirectional=true)) @test all( warn_log == (capacity=true, opex_var=true, opex_fixed=true, - inputs=false, outputs=false, loss=true, consumption_rate=false, data=true) + inputs=false, outputs=false, loss=true, consumption_rate=false, data=false) ) EMB.outputs(tm::TestMode) = [ResourceCarrier("test", 0.0)] EMG.loss(tm::TestMode) = FixedProfile(10) @@ -30,7 +30,7 @@ end @test all(err_log == (inputs=true, outputs=false, bidirectional=true)) @test all( warn_log == (capacity=true, opex_var=true, opex_fixed=true, - inputs=false, outputs=false, loss=false, consumption_rate=false, data=true) + inputs=false, outputs=false, loss=false, consumption_rate=false, data=false) ) Base.delete_method(@which outputs(mode)) Base.delete_method(@which loss(mode)) From 20317bf6881fbedad8bb17871df89ddfaa59fb3f Mon Sep 17 00:00:00 2001 From: Lucas Ferreira Bernardino Date: Thu, 18 Dec 2025 10:42:01 +0100 Subject: [PATCH 3/3] Typo fixes --- docs/src/index.md | 2 +- docs/src/manual/use.md | 4 ++-- ext/EMGExt/compliance_ele.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index b08ad1f..ca6483e 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,7 +1,7 @@ # EnergyModelsCompliance `EnergyModelsCompliance` is a utility package for the `EnergyModelsX` framework focusing on providing the user with functionality to check whether newly developed element descriptions are complying with the framework. -These functions are included for both [`EnergyModelsBase`](https://energymodelsx.github.io/EnergyModelsBase.jl/stable/) and [`EnergyModelsGeography`](https://energymodelsx.github.io/EnergyModelsGeography.jl/stable/) +These functions are included for both [`EnergyModelsBase`](https://energymodelsx.github.io/EnergyModelsBase.jl/stable/) and [`EnergyModelsGeography`](https://energymodelsx.github.io/EnergyModelsGeography.jl/stable/). It should be utilized for obtaining an overview of potential problems, but **not** as substitution for rigorous testing. diff --git a/docs/src/manual/use.md b/docs/src/manual/use.md index a62dde0..e3db508 100644 --- a/docs/src/manual/use.md +++ b/docs/src/manual/use.md @@ -26,7 +26,7 @@ In this case, the model would not construct. However, if a developer provide new methods for their developed node, it is possible to ignore the warnings. An example is given by the function [`opex_fixed`](@extref EnergyModelsBase.opex_fixed). This function is only called in the function [`constraints_opex_fixed`](@extref EnergyModelsBase.constraints_opex_fixed). -Hence, if you do not use the function, you can ignore the warning +Hence, if you do not use the function, you can ignore the warning. ### [Test case](@id man-use-concepts-test) @@ -65,7 +65,7 @@ There are however a few important caveats when using the function for `Node`s. !!! warning "Rigorous testing" The developed function should only be used for identifying major problems with new elements. - It does **not** provide a rigerous test for the new element. + It does **not** provide a rigorous test for the new element. This is especially relevant for the mathematical formulation, as we cannot include automated tests for unknown mathematical formulations. It is hence necessary that you test your element further with changes in the input representing your specific element. diff --git a/ext/EMGExt/compliance_ele.jl b/ext/EMGExt/compliance_ele.jl index f09a32f..d56bf1d 100644 --- a/ext/EMGExt/compliance_ele.jl +++ b/ext/EMGExt/compliance_ele.jl @@ -21,7 +21,7 @@ the indivdiual test functions. The called test functions are dependent on the ch - [`compliance_bidirectional`](@ref). !!! warning - [`EMC.compliance_data`](@ref) is in the current stage removed as changes to the + [`EMC.compliance_data`](@ref) is in the current stage removed due to changes to the handling of `ExtensionData`. !!! note "Areas"