diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47035fa..316510a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,18 +22,18 @@ jobs: - version: '1' # The latest point-release (Windows) os: windows-latest arch: x64 - - version: '1.9' # 1.9 + - version: 'lts' # lts os: ubuntu-latest arch: x64 - - version: '1.9' # 1.9 + - version: 'lts' # lts os: ubuntu-latest arch: x86 # - version: 'nightly' # os: ubuntu-latest # arch: x64 steps: - - uses: actions/checkout@v3 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} @@ -50,8 +50,4 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 with: - depwarn: error - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 - with: - file: lcov.info \ No newline at end of file + depwarn: error \ No newline at end of file diff --git a/NEWS.md b/NEWS.md index a8e674a..8c54106 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,12 @@ # Release notes -## Unversioned +## Version 0.10.1 (2024-10-16) ### Minor updates * Reworked the tests and included the tests for investments. * Included an option to deactive the checks entirely with printing a warning, similarly to `EnergyModelsBase`. +* Adjusted to [`EnergyModelsBase` v0.8.1](https://github.com/EnergyModelsX/EnergyModelsBase.jl/releases/tag/v0.8.1) and [`EnergyModelsInvestments` v0.8.0](https://github.com/EnergyModelsX/EnergyModelsInvestments.jl/releases/tag/v0.8.0). ### Rework of documentation diff --git a/Project.toml b/Project.toml index 8c637d8..58eeeb4 100644 --- a/Project.toml +++ b/Project.toml @@ -16,9 +16,9 @@ EnergyModelsInvestments = "fca3f8eb-b383-437d-8e7b-aac76bb2004f" EMIExt = "EnergyModelsInvestments" [compat] -EnergyModelsBase = "^0.8" -EnergyModelsInvestments = "0.7" +EnergyModelsBase = "0.8.1" +EnergyModelsInvestments = "0.8" SparseVariables = "0.7.3" JuMP = "1.5" -TimeStruct = "^0.8" -julia = "1.9" +TimeStruct = "0.9" +julia = "1.10" diff --git a/docs/src/area_mode/area.md b/docs/src/area_mode/area.md index 3fbf7f9..8961e65 100644 --- a/docs/src/area_mode/area.md +++ b/docs/src/area_mode/area.md @@ -120,7 +120,7 @@ This constraint is given by The [`GeoAvailability`](@ref) node is introduced to allow the energy balance of an area being handled on the [`Area`](@ref) level. It is in itself equivalent to the to [`GenAvailability`](@extref EnergyModelsBase.GenAvailability) node with respect to introduced fields and variables. -*[Availability node]* provides a detailed description of availability nodes. +*[Availability node](@extref EnergyModelsBase nodes-availability)* provides a detailed description of availability nodes. !!! warning "Energy exchange" All energy exchange between different areas is routed through a [`GeoAvailability`](@ref) node. diff --git a/docs/src/area_mode/mode.md b/docs/src/area_mode/mode.md index 1203f54..9bf5c2d 100644 --- a/docs/src/area_mode/mode.md +++ b/docs/src/area_mode/mode.md @@ -226,7 +226,7 @@ The following standard constraints are implemented for a [`TransmissionMode`](@r \begin{aligned} \texttt{trans\_opex\_var}[tm, t_{inv}] = \sum_{t \in t_{inv}} & opex\_var(tm, t) \times \\ & \texttt{trans\_out}[tm, t] \times \\ & - EMB.multiple(t_{inv}, t) + scale\_op\_sp(t_{inv}, t) \end{aligned} ``` @@ -236,12 +236,12 @@ The following standard constraints are implemented for a [`TransmissionMode`](@r \begin{aligned} \texttt{trans\_opex\_var}[tm, t_{inv}] = \sum_{t \in t_{inv}} & opex\_var(tm, t) \times \\ & \left(\texttt{trans\_pos}[tm, t] + \texttt{trans\_neg}[tm, t]\right) \times \\ & - EMB.multiple(t_{inv}, t) + scale\_op\_sp(t_{inv}, t) \end{aligned} ``` - !!! tip "The function `EMB.multiple`" - The function [``EMB.multiple(t_{inv}, t)``](@ref EnergyModelsBase.multiple) calculates the scaling factor between operational and strategic periods. + !!! tip "The function `scale_op_sp`" + The function [``scale\_op\_sp(t_{inv}, t)``](@ref EnergyModelsBase.scale_op_sp) calculates the scaling factor between operational and strategic periods. It also takes into account potential operational scenarios and their probability as well as representative periods. - `constraints_emissions`: diff --git a/examples/investments.jl b/examples/investments.jl index e57a2fb..069243b 100644 --- a/examples/investments.jl +++ b/examples/investments.jl @@ -77,28 +77,28 @@ function generate_example_data_geo() inv_data_12 = SingleInvData( FixedProfile(500), FixedProfile(50), - 0, + FixedProfile(0), BinaryInvestment(FixedProfile(50.0)), ) inv_data_13 = SingleInvData( FixedProfile(10), FixedProfile(100), - 0, + FixedProfile(0), SemiContinuousInvestment(FixedProfile(10), FixedProfile(100)), ) inv_data_23 = SingleInvData( FixedProfile(10), FixedProfile(50), - 20, + FixedProfile(20), DiscreteInvestment(FixedProfile(6)), ) inv_data_34 = SingleInvData( FixedProfile(10), FixedProfile(50), - 0, + FixedProfile(0), ContinuousInvestment(FixedProfile(1), FixedProfile(100)), ) @@ -349,7 +349,7 @@ function get_sub_system_data_inv( SingleInvData( FixedProfile(1000), # capex [€/kW] FixedProfile(200), # max installed capacity [kW] - 0, + FixedProfile(0), ContinuousInvestment(FixedProfile(10), FixedProfile(200)), # investment mode ), ], diff --git a/src/constraint_functions.jl b/src/constraint_functions.jl index c013128..14c6642 100644 --- a/src/constraint_functions.jl +++ b/src/constraint_functions.jl @@ -218,14 +218,14 @@ function constraints_opex_var(m, tm::TransmissionMode, 𝒯ᴵⁿᵛ, modeltype: m[:trans_opex_var][tm, t_inv] == sum( (m[:trans_pos][tm, t] + m[:trans_neg][tm, t]) * - opex_var(tm, t_inv) * EMB.multiple(t_inv, t) + opex_var(tm, t_inv) * scale_op_sp(t_inv, t) for t ∈ t_inv) ) else @constraint(m, [t_inv ∈ 𝒯ᴵⁿᵛ], m[:trans_opex_var][tm, t_inv] == sum( - m[:trans_out][tm, t] * opex_var(tm, t) * EMB.multiple(t_inv, t) + m[:trans_out][tm, t] * opex_var(tm, t) * scale_op_sp(t_inv, t) for t ∈ t_inv) ) end diff --git a/src/model.jl b/src/model.jl index ecd3977..fdb99a4 100644 --- a/src/model.jl +++ b/src/model.jl @@ -30,7 +30,7 @@ function create_model( ) @debug "Construct model" # Call of the basic model - m = EMB.create_model(case, modeltype, m; check_timeprofiles) + m = EMB.create_model(case, modeltype, m; check_timeprofiles, check_any_data) if check_any_data check_data(case, modeltype, check_timeprofiles) end diff --git a/test/test_investments.jl b/test/test_investments.jl index 42fb2bf..5db9969 100644 --- a/test/test_investments.jl +++ b/test/test_investments.jl @@ -55,7 +55,7 @@ function small_graph_geo(; source = nothing, sink = nothing, inv_data = nothing) transmission_line = RefStatic( "transline", Power, - FixedProfile(10), + FixedProfile(0), FixedProfile(0.1), FixedProfile(0.0), FixedProfile(0.0), @@ -124,7 +124,7 @@ end inv_data = SingleInvData( FixedProfile(10), # capex [€/kW] FixedProfile(250), # max installed capacity [kW] - 0, # initial capacity [kW] + FixedProfile(0), # initial capacity [kW] ContinuousInvestment(FixedProfile(0), FixedProfile(30)), ) @@ -151,7 +151,7 @@ end for t ∈ t_inv @test ( value.(m[:trans_cap_add][tm, t_inv]) ≈ - capacity(sink, t) - inv_data.initial + capacity(sink, t) - EMI.start_cap(tm, t_inv, inv_data, nothing) ) atol = TEST_ATOL end end @@ -176,7 +176,7 @@ end inv_data = SingleInvData( FixedProfile(10), # capex [€/kW] FixedProfile(250), # max installed capacity [kW] - 0, # initial capacity [kW] + FixedProfile(0), # initial capacity [kW] SemiContinuousInvestment(FixedProfile(10), FixedProfile(30)), ) @@ -204,7 +204,7 @@ end for t ∈ t_inv @test ( value.(m[:trans_cap_add][tm, t_inv]) >= max( - capacity(sink, t) - inv_data.initial, + capacity(sink, t) - EMI.start_cap(tm, t_inv, inv_data, nothing), EMI.min_add(inv_data, t) * value.(m[:trans_cap_invest_b][tm, t_inv]), ) @@ -247,7 +247,6 @@ end inv_data = SingleInvData( FixedProfile(10), # capex [€/kW] FixedProfile(250), # max installed capacity [kW] - 0, # initial capacity [kW] SemiContinuousOffsetInvestment( FixedProfile(10), FixedProfile(30), @@ -279,8 +278,8 @@ end if isnothing(t_inv_prev) for t ∈ t_inv @test ( - value.(m[:trans_cap_add][tm, t_inv]) >= max( - capacity(sink, t) - inv_data.initial, + value.(m[:trans_cap_add][tm, t_inv]) ⪆ max( + capacity(sink, t) - EMI.start_cap(tm, t_inv, inv_data, nothing), EMI.min_add(inv_data, t) * value.(m[:trans_cap_invest_b][tm, t_inv]), ) @@ -329,7 +328,7 @@ end inv_data = SingleInvData( FixedProfile(10), # capex [€/kW] FixedProfile(250), # max installed capacity [kW] - 0, # initial capacity [kW] + FixedProfile(0), # initial capacity [kW] DiscreteInvestment(FixedProfile(5)), )