From 9290624cb868a814fd3b318cf659b23ef920032d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Str=C3=B6mer?= Date: Wed, 27 Nov 2024 22:17:49 +0100 Subject: [PATCH 1/5] fix: rely on JuliaSyntax's tokenize to split expressions instead of using a regex --- src/core/expression.jl | 68 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/src/core/expression.jl b/src/core/expression.jl index 6134b824..14044c53 100644 --- a/src/core/expression.jl +++ b/src/core/expression.jl @@ -1,6 +1,5 @@ function _string_to_fevalexpr(@nospecialize(str::AbstractString)) buf = IOBuffer(; sizehint=length(str)) - it = eachsplit(str, r"(?<=[+\-*/ ()])|(?=[+\-*/ ()])") # Instead of interpolating the explicit things a user might access in a string directly into the returned # expression, we extract them, and replace them by consecutive placeholders. This way, the function that is @@ -11,9 +10,32 @@ function _string_to_fevalexpr(@nospecialize(str::AbstractString)) starting_access_index = 1 extracted_expressions = NamedTuple[] - for elem in it - if any(isletter(c) for c in elem) - if !contains(elem, r"[:|@]") + tokens = JuliaSyntax.tokenize(str) + TOK_TOMB = JuliaSyntax.Token(JuliaSyntax.SyntaxHead(JuliaSyntax.K"TOMBSTONE", 0), 0:0) + last_token = TOK_TOMB + + while !isempty(tokens) + token = popfirst!(tokens) + if JuliaSyntax.kind(token) == JuliaSyntax.K"Identifier" + if !isempty(tokens) && ( + JuliaSyntax.kind(first(tokens)) == JuliaSyntax.K"@" || + JuliaSyntax.kind(first(tokens)) == JuliaSyntax.K":" + ) + if JuliaSyntax.kind(last_token) in + (JuliaSyntax.K"Identifier", JuliaSyntax.K"Integer", JuliaSyntax.K"Float") + @critical "Detected ambiguous command in expression; if you are using, e.g., a column accessor of a file that starts with a number, we cannot determine that properly because `4x` has the same meaning as `4*x` in Julia, but you could also mean a column named `\"4x\"`; please refactor this and run the model again" expression = + str command = join(JuliaSyntax.untokenize.((last_token, token), str)) + end + + seperator = popfirst!(tokens) # TODO: this is actually just `next_token` + next_token = popfirst!(tokens) # this is the token after the seperator + + push!(access_order, join(JuliaSyntax.untokenize.((token, seperator, next_token), str))) + write(buf, "__el[$(length(access_order) - starting_access_index + 1)]") + last_token = next_token + else + # This is a "carrier" as part of a conversion expression. + elem = JuliaSyntax.untokenize(token, str) e = JuliaSyntax.parsestmt(Expr, String(take!(buf))) if length(access_order) >= starting_access_index @@ -26,12 +48,12 @@ function _string_to_fevalexpr(@nospecialize(str::AbstractString)) value = convert(Float64, eval(e)) push!(extracted_expressions, (name=elem, val=value)) end - else - push!(access_order, elem) - write(buf, "__el[$(length(access_order) - starting_access_index + 1)]") + + last_token = TOK_TOMB end else - write(buf, elem) + write(buf, JuliaSyntax.untokenize(token, str)) + last_token = token end end @@ -52,6 +74,36 @@ function _string_to_fevalexpr(@nospecialize(str::AbstractString)) return extracted_expressions end +@testitem "string_to_fevalexpr" tags = [:unittest] begin + stf = IESopt._string_to_fevalexpr + + @test stf("1 + 1")[1].name == "" + @test stf("1 + 1")[1].val == 2.0 + + @test stf("10 * col@file")[1].func(2) == 20 + @test stf("1e3 * col@file")[1].func(2) == 2000.0 + @test stf("1e-2 * col@file")[1].func(2) == 2e-2 + @test stf("1e-2-1.5*col@file")[1].func(2) == 1e-2 - 1.5 * 2 + + @test stf("1e-6 * 7 + col@file/10.3e4 * (sizing:value*0.3e-11-col2@file2)")[1].func([1, 2, 3]) ≈ -2.21262136e-5 + + @test_throws ErrorException stf("(08_pv@data+13) * testdec:value /0.4 + 08_pv@data/0.76") + @test stf("(a08_pv@data+13) * testdec:value /0.4 + a08_pv@data/0.76")[1].func([1, 2, 3]) ≈ 73.94736842105263 + + @test_throws ErrorException stf("08_pv@data electricity") + @test_throws ErrorException stf("1.0*08_pv@data") + @test_throws ErrorException stf("08_pv@data-3") + @test_throws ErrorException stf("1+08_pv@data") + @test_throws ErrorException stf("(08_pv@data)") + + e = stf("(0.01 + pv@data)/0.01 electricity + pv@data*10 heat") + @test length(e) == 2 + @test e[1].name == "electricity" + @test e[2].name == "heat" + @test e[1].func(10.0) == 1001.0 + @test e[2].func(10.0) == 100.0 +end + abstract type _AbstractExpressionType end struct _GeneralExpressionType <: _AbstractExpressionType end struct _ConversionExpressionType <: _AbstractExpressionType end From 21e2275e419905937d1ba5f8375afbd4cecfd83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Str=C3=B6mer?= Date: Wed, 27 Nov 2024 22:18:16 +0100 Subject: [PATCH 2/5] test: add mwe from #35 as test case --- test/src/basic.jl | 3 +++ test/test_files/issue35.iesopt.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 test/test_files/issue35.iesopt.yaml diff --git a/test/src/basic.jl b/test/src/basic.jl index a51c2a03..8e334012 100644 --- a/test/src/basic.jl +++ b/test/src/basic.jl @@ -14,6 +14,9 @@ model = generate!(joinpath(PATH_TESTFILES, "availability_test_failure.iesopt.yaml")) @suppress optimize!(model) # `@test_logs` fails because: https://github.com/JuliaLang/julia/issues/48456 @test JuMP.termination_status(model) == JuMP.MOI.INFEASIBLE + + model = generate!(joinpath(PATH_TESTFILES, "issue35.iesopt.yaml")) + @test access(get_component(model, "electricity_demand").value) ≈ 7e-6 end @testset "Filesystem paths" verbose = true begin diff --git a/test/test_files/issue35.iesopt.yaml b/test/test_files/issue35.iesopt.yaml new file mode 100644 index 00000000..88a121aa --- /dev/null +++ b/test/test_files/issue35.iesopt.yaml @@ -0,0 +1,28 @@ +config: + optimization: + problem_type: LP + snapshots: + count: 1 + solver: + name: highs + +carriers: + electricity: {} + +components: + electricity_node: + type: Node + carrier: electricity + + electricity_market: + type: Profile + carrier: electricity + node_to: electricity_node + cost: 50 + mode: ranged + + electricity_demand: + type: Profile + carrier: electricity + node_from: electricity_node + value: 1e-6 * 7 \ No newline at end of file From 464135c6f7fc68e30c8a2f3304e7c879e82e2b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Str=C3=B6mer?= Date: Wed, 27 Nov 2024 22:22:07 +0100 Subject: [PATCH 3/5] assets: fix ambigous column names in example input data files --- src/assets/examples/07_csv_filestorage.iesopt.yaml | 8 ++++---- src/assets/examples/08_basic_investment.iesopt.yaml | 4 ++-- src/assets/examples/10_basic_load_shedding.iesopt.yaml | 4 ++-- src/assets/examples/15_varying_efficiency.iesopt.yaml | 4 ++-- .../examples/17_varying_connection_capacity.iesopt.yaml | 2 +- src/assets/examples/37_certificates.iesopt.yaml | 6 +++--- src/assets/examples/46_constants_in_objective.iesopt.yaml | 4 ++-- src/assets/examples/48_custom_results.iesopt.yaml | 2 +- src/assets/examples/files/09/profiles.csv | 4 ++-- src/assets/examples/files/09/units.csv | 2 +- src/assets/examples/files/example_data.csv | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/assets/examples/07_csv_filestorage.iesopt.yaml b/src/assets/examples/07_csv_filestorage.iesopt.yaml index 93bd13fa..f1759f2b 100644 --- a/src/assets/examples/07_csv_filestorage.iesopt.yaml +++ b/src/assets/examples/07_csv_filestorage.iesopt.yaml @@ -63,8 +63,8 @@ components: conversion: 1 wind -> 1 electricity capacity: 10 out:electricity # Instead of cluttering our YAML with 8760 entries, we now just load it from a CSV. This is done by supplying the - # correct column (07_plant_wind_availability_factor) that can be found in the CSV (data) like so: - availability_factor: 07_plant_wind_availability_factor@data + # correct column (ex07_plant_wind_availability_factor) that can be found in the CSV (data) like so: + availability_factor: ex07_plant_wind_availability_factor@data plant_gas: type: Unit @@ -78,14 +78,14 @@ components: carrier: electricity node_from: node1 # Again, now loading from CSV. - value: 07_demand1_value@data + value: ex07_demand1_value@data demand2: type: Profile carrier: electricity node_from: node2 # Again, now loading from CSV. - value: 07_demand2_value@data + value: ex07_demand2_value@data gas_grid: type: Node diff --git a/src/assets/examples/08_basic_investment.iesopt.yaml b/src/assets/examples/08_basic_investment.iesopt.yaml index 8104dc94..e939cf49 100644 --- a/src/assets/examples/08_basic_investment.iesopt.yaml +++ b/src/assets/examples/08_basic_investment.iesopt.yaml @@ -87,7 +87,7 @@ components: outputs: {electricity: elec} conversion: ~ -> 1 electricity capacity: 1 out:electricity - availability_factor: 08_pv@data + availability_factor: ex08_pv@data electrolysis: type: Unit @@ -100,6 +100,6 @@ components: type: Profile carrier: h2 node_from: h2_south - value: 08_demand@data + value: ex08_demand@data diff --git a/src/assets/examples/10_basic_load_shedding.iesopt.yaml b/src/assets/examples/10_basic_load_shedding.iesopt.yaml index 4bd9b1dc..06b92ce9 100644 --- a/src/assets/examples/10_basic_load_shedding.iesopt.yaml +++ b/src/assets/examples/10_basic_load_shedding.iesopt.yaml @@ -72,7 +72,7 @@ components: outputs: {electricity: elec} conversion: ~ -> 1 electricity capacity: 1 out:electricity - availability_factor: 08_pv@data + availability_factor: ex08_pv@data electrolysis: type: Unit @@ -85,7 +85,7 @@ components: type: Profile carrier: h2 node_from: h2_south - value: 08_demand@data + value: ex08_demand@data # This allows the "reducing demand" (load shedding) by introducing a Profile that covers the missing energy. shedding: diff --git a/src/assets/examples/15_varying_efficiency.iesopt.yaml b/src/assets/examples/15_varying_efficiency.iesopt.yaml index ce985307..1800f479 100644 --- a/src/assets/examples/15_varying_efficiency.iesopt.yaml +++ b/src/assets/examples/15_varying_efficiency.iesopt.yaml @@ -25,7 +25,7 @@ components: heatpump: type: Unit capacity: 100 out:heat - conversion: 1 electricity -> 15_cop@data heat + conversion: 1 electricity -> ex15_cop@data heat conversion_at_min: 1 electricity -> 1 heat min_conversion: 0.2 unit_commitment: binary @@ -52,7 +52,7 @@ components: carrier: heat mode: fixed node_from: heat_grid - value: 15_heatdemand@data + value: ex15_heatdemand@data # We allow "throwing away heat" (essentially allowing the heat_demand to extend beyond the set value) heat_demand_deviation: diff --git a/src/assets/examples/17_varying_connection_capacity.iesopt.yaml b/src/assets/examples/17_varying_connection_capacity.iesopt.yaml index a72acfb5..9bc5611b 100644 --- a/src/assets/examples/17_varying_connection_capacity.iesopt.yaml +++ b/src/assets/examples/17_varying_connection_capacity.iesopt.yaml @@ -35,7 +35,7 @@ components: conn: type: Connection - capacity: 17_capacity@data + capacity: ex17_capacity@data node_from: node1 node_to: node2 diff --git a/src/assets/examples/37_certificates.iesopt.yaml b/src/assets/examples/37_certificates.iesopt.yaml index 44cf2b22..560112ed 100644 --- a/src/assets/examples/37_certificates.iesopt.yaml +++ b/src/assets/examples/37_certificates.iesopt.yaml @@ -57,7 +57,7 @@ components: outputs: {electricity: node2} conversion: 1 wind -> 1 electricity capacity: 20 out:electricity - availability_factor: 07_plant_wind_availability_factor@data + availability_factor: ex07_plant_wind_availability_factor@data gas_certificates: type: Node @@ -98,13 +98,13 @@ components: type: Profile carrier: electricity node_from: node1 - value: 07_demand1_value@data + value: ex07_demand1_value@data demand2: type: Profile carrier: electricity node_from: node2 - value: 07_demand2_value@data + value: ex07_demand2_value@data gas_grid: type: Node diff --git a/src/assets/examples/46_constants_in_objective.iesopt.yaml b/src/assets/examples/46_constants_in_objective.iesopt.yaml index 9bab46ab..d5be061f 100644 --- a/src/assets/examples/46_constants_in_objective.iesopt.yaml +++ b/src/assets/examples/46_constants_in_objective.iesopt.yaml @@ -70,7 +70,7 @@ components: outputs: {electricity: elec} conversion: ~ -> 1 electricity capacity: 1 out:electricity - availability_factor: 08_pv@data + availability_factor: ex08_pv@data objectives: {total_cost: } electrolysis: @@ -84,6 +84,6 @@ components: type: Profile carrier: h2 node_from: h2_south - value: 08_demand@data + value: ex08_demand@data diff --git a/src/assets/examples/48_custom_results.iesopt.yaml b/src/assets/examples/48_custom_results.iesopt.yaml index 1dab5a2b..ec3fc3e3 100644 --- a/src/assets/examples/48_custom_results.iesopt.yaml +++ b/src/assets/examples/48_custom_results.iesopt.yaml @@ -48,7 +48,7 @@ components: conversion: ~ -> 1 electricity capacity: 10 out:electricity marginal_cost: 10 per out:electricity - availability_factor: 07_plant_wind_availability_factor@data + availability_factor: ex07_plant_wind_availability_factor@data storage: type: CustomStorage diff --git a/src/assets/examples/files/09/profiles.csv b/src/assets/examples/files/09/profiles.csv index 5080709e..28319972 100644 --- a/src/assets/examples/files/09/profiles.csv +++ b/src/assets/examples/files/09/profiles.csv @@ -1,5 +1,5 @@ name,type,mode,carrier,node_to,node_from,value,cost availability,Profile,create,wind,wind,,, -demand1,Profile,,electricity,,node1,07_demand1_value@data, -demand2,Profile,,electricity,,node2,07_demand2_value@data, +demand1,Profile,,electricity,,node1,ex07_demand1_value@data, +demand2,Profile,,electricity,,node2,ex07_demand2_value@data, create_gas,Profile,create,gas,gas_grid,,,50 \ No newline at end of file diff --git a/src/assets/examples/files/09/units.csv b/src/assets/examples/files/09/units.csv index c7de9d49..3171bb5a 100644 --- a/src/assets/examples/files/09/units.csv +++ b/src/assets/examples/files/09/units.csv @@ -1,3 +1,3 @@ name,type,inputs,outputs,conversion,capacity,availability_factor -plant_wind,Unit,"{'wind': 'wind'}","{'electricity': 'node2'}",1 wind -> 1 electricity,10 out:electricity,07_plant_wind_availability_factor@data +plant_wind,Unit,"{'wind': 'wind'}","{'electricity': 'node2'}",1 wind -> 1 electricity,10 out:electricity,ex07_plant_wind_availability_factor@data plant_gas,Unit,"{'gas': 'gas_grid'}","{'electricity': 'node1', 'co2': 'total_co2'}",1 gas -> 0.4 electricity + 0.2 co2,10 out:electricity \ No newline at end of file diff --git a/src/assets/examples/files/example_data.csv b/src/assets/examples/files/example_data.csv index 2937630f..ac72c75d 100644 --- a/src/assets/examples/files/example_data.csv +++ b/src/assets/examples/files/example_data.csv @@ -1,4 +1,4 @@ -07_plant_wind_availability_factor,07_demand1_value,07_demand2_value,08_pv,08_demand,15_cop,15_cop_minconversion,15_heatdemand,17_capacity +ex07_plant_wind_availability_factor,ex07_demand1_value,ex07_demand2_value,ex08_pv,ex08_demand,ex15_cop,ex15_cop_minconversion,ex15_heatdemand,ex17_capacity 0.88,2.06,4.88,0,0,2.12,1.484,45,5 0.07,4.11,3.32,0,0,2.12,1.484,45,3 0.87,4.07,1.53,0.02,0,2.12,1.484,46,1 From a104ae2502244d81a2810deb3629144fcab2a9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Str=C3=B6mer?= Date: Wed, 27 Nov 2024 22:29:59 +0100 Subject: [PATCH 4/5] chore: prep for v2.0.3 --- Project.toml | 2 +- src/assets/examples/01_basic_single_node.iesopt.yaml | 2 +- src/assets/examples/02_advanced_single_node.iesopt.yaml | 2 +- src/assets/examples/03_basic_two_nodes.iesopt.yaml | 2 +- src/assets/examples/04_soft_constraints.iesopt.yaml | 2 +- src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml | 2 +- src/assets/examples/06_recursion_h2.iesopt.yaml | 2 +- src/assets/examples/07_csv_filestorage.iesopt.yaml | 2 +- src/assets/examples/08_basic_investment.iesopt.yaml | 2 +- src/assets/examples/09_csv_only.iesopt.yaml | 2 +- src/assets/examples/10_basic_load_shedding.iesopt.yaml | 2 +- src/assets/examples/11_basic_unit_commitment.iesopt.yaml | 2 +- src/assets/examples/12_incremental_efficiency.iesopt.yaml | 2 +- src/assets/examples/15_varying_efficiency.iesopt.yaml | 2 +- src/assets/examples/16_noncore_components.iesopt.yaml | 2 +- src/assets/examples/17_varying_connection_capacity.iesopt.yaml | 2 +- src/assets/examples/18_addons.iesopt.yaml | 2 +- src/assets/examples/20_chp.iesopt.yaml | 2 +- src/assets/examples/22_snapshot_weights.iesopt.yaml | 2 +- src/assets/examples/23_snapshots_from_csv.iesopt.yaml | 2 +- src/assets/examples/25_global_parameters.iesopt.yaml | 2 +- src/assets/examples/26_initial_states.iesopt.yaml | 2 +- src/assets/examples/27_piecewise_linear_costs.iesopt.yaml | 2 +- src/assets/examples/29_advanced_unit_commitment.iesopt.yaml | 2 +- src/assets/examples/30_representative_snapshots.iesopt.yaml | 2 +- src/assets/examples/31_exclusive_operation.iesopt.yaml | 2 +- src/assets/examples/32_sos.iesopt.yaml | 2 +- src/assets/examples/33_benders_investment.iesopt.yaml | 2 +- src/assets/examples/34_piecewise_linear_costs.iesopt.yaml | 2 +- src/assets/examples/35_fixed_costs.iesopt.yaml | 2 +- src/assets/examples/36_stochastic_investment.iesopt.yaml | 2 +- src/assets/examples/37_certificates.iesopt.yaml | 2 +- src/assets/examples/41_multiobjective_epsilon.iesopt.yaml | 2 +- src/assets/examples/42_multiobjective_lexicographic.iesopt.yaml | 2 +- src/assets/examples/43_multiobjective_hierarchical.iesopt.yaml | 2 +- src/assets/examples/44_lossy_connections.iesopt.yaml | 2 +- src/assets/examples/45_result_extraction.iesopt.yaml | 2 +- src/assets/examples/46_constants_in_objective.iesopt.yaml | 2 +- src/assets/examples/47_disable_components.iesopt.yaml | 2 +- src/assets/examples/48_custom_results.iesopt.yaml | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Project.toml b/Project.toml index b4a7c647..1bce00c6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "IESopt" uuid = "ed3f0a38-8ad9-4cf8-877e-929e8d190fe9" -version = "2.0.2" +version = "2.0.3" [deps] ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" diff --git a/src/assets/examples/01_basic_single_node.iesopt.yaml b/src/assets/examples/01_basic_single_node.iesopt.yaml index 9b15c14b..117178e5 100644 --- a/src/assets/examples/01_basic_single_node.iesopt.yaml +++ b/src/assets/examples/01_basic_single_node.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: # This specifies the overall type of optimization problem. If using "LP" like here, no component can utilize # formulations that are of a "higher" class (e.g. MILP). diff --git a/src/assets/examples/02_advanced_single_node.iesopt.yaml b/src/assets/examples/02_advanced_single_node.iesopt.yaml index 2e41964e..b3b9454f 100644 --- a/src/assets/examples/02_advanced_single_node.iesopt.yaml +++ b/src/assets/examples/02_advanced_single_node.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/03_basic_two_nodes.iesopt.yaml b/src/assets/examples/03_basic_two_nodes.iesopt.yaml index 304bf6d4..9374e981 100644 --- a/src/assets/examples/03_basic_two_nodes.iesopt.yaml +++ b/src/assets/examples/03_basic_two_nodes.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/04_soft_constraints.iesopt.yaml b/src/assets/examples/04_soft_constraints.iesopt.yaml index a2648824..d5e982a9 100644 --- a/src/assets/examples/04_soft_constraints.iesopt.yaml +++ b/src/assets/examples/04_soft_constraints.iesopt.yaml @@ -17,7 +17,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml b/src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml index 0a9df07f..b809e279 100644 --- a/src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml +++ b/src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/06_recursion_h2.iesopt.yaml b/src/assets/examples/06_recursion_h2.iesopt.yaml index d323c324..138ca5ee 100644 --- a/src/assets/examples/06_recursion_h2.iesopt.yaml +++ b/src/assets/examples/06_recursion_h2.iesopt.yaml @@ -6,7 +6,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/07_csv_filestorage.iesopt.yaml b/src/assets/examples/07_csv_filestorage.iesopt.yaml index 578da659..58e27f23 100644 --- a/src/assets/examples/07_csv_filestorage.iesopt.yaml +++ b/src/assets/examples/07_csv_filestorage.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/08_basic_investment.iesopt.yaml b/src/assets/examples/08_basic_investment.iesopt.yaml index 6635f19d..1e6b137d 100644 --- a/src/assets/examples/08_basic_investment.iesopt.yaml +++ b/src/assets/examples/08_basic_investment.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/09_csv_only.iesopt.yaml b/src/assets/examples/09_csv_only.iesopt.yaml index 99cdd1ea..8377bd3a 100644 --- a/src/assets/examples/09_csv_only.iesopt.yaml +++ b/src/assets/examples/09_csv_only.iesopt.yaml @@ -6,7 +6,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/10_basic_load_shedding.iesopt.yaml b/src/assets/examples/10_basic_load_shedding.iesopt.yaml index 46259e45..aa423344 100644 --- a/src/assets/examples/10_basic_load_shedding.iesopt.yaml +++ b/src/assets/examples/10_basic_load_shedding.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/11_basic_unit_commitment.iesopt.yaml b/src/assets/examples/11_basic_unit_commitment.iesopt.yaml index 4a961e2a..91c9bf09 100644 --- a/src/assets/examples/11_basic_unit_commitment.iesopt.yaml +++ b/src/assets/examples/11_basic_unit_commitment.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/12_incremental_efficiency.iesopt.yaml b/src/assets/examples/12_incremental_efficiency.iesopt.yaml index c1f4b69f..963749e1 100644 --- a/src/assets/examples/12_incremental_efficiency.iesopt.yaml +++ b/src/assets/examples/12_incremental_efficiency.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/15_varying_efficiency.iesopt.yaml b/src/assets/examples/15_varying_efficiency.iesopt.yaml index 3f8c8211..23ca134a 100644 --- a/src/assets/examples/15_varying_efficiency.iesopt.yaml +++ b/src/assets/examples/15_varying_efficiency.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP snapshots: diff --git a/src/assets/examples/16_noncore_components.iesopt.yaml b/src/assets/examples/16_noncore_components.iesopt.yaml index 5eb9a3e2..5717c0a0 100644 --- a/src/assets/examples/16_noncore_components.iesopt.yaml +++ b/src/assets/examples/16_noncore_components.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/17_varying_connection_capacity.iesopt.yaml b/src/assets/examples/17_varying_connection_capacity.iesopt.yaml index ff2ad769..d86464a3 100644 --- a/src/assets/examples/17_varying_connection_capacity.iesopt.yaml +++ b/src/assets/examples/17_varying_connection_capacity.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP snapshots: diff --git a/src/assets/examples/18_addons.iesopt.yaml b/src/assets/examples/18_addons.iesopt.yaml index eb01b271..1e2874da 100644 --- a/src/assets/examples/18_addons.iesopt.yaml +++ b/src/assets/examples/18_addons.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/20_chp.iesopt.yaml b/src/assets/examples/20_chp.iesopt.yaml index 8a317982..66e0d5f5 100644 --- a/src/assets/examples/20_chp.iesopt.yaml +++ b/src/assets/examples/20_chp.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP snapshots: diff --git a/src/assets/examples/22_snapshot_weights.iesopt.yaml b/src/assets/examples/22_snapshot_weights.iesopt.yaml index cede0ad8..d097b0e1 100644 --- a/src/assets/examples/22_snapshot_weights.iesopt.yaml +++ b/src/assets/examples/22_snapshot_weights.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/23_snapshots_from_csv.iesopt.yaml b/src/assets/examples/23_snapshots_from_csv.iesopt.yaml index 51ebb8cb..bbace34d 100644 --- a/src/assets/examples/23_snapshots_from_csv.iesopt.yaml +++ b/src/assets/examples/23_snapshots_from_csv.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP snapshots: diff --git a/src/assets/examples/25_global_parameters.iesopt.yaml b/src/assets/examples/25_global_parameters.iesopt.yaml index e8f65745..42668de2 100644 --- a/src/assets/examples/25_global_parameters.iesopt.yaml +++ b/src/assets/examples/25_global_parameters.iesopt.yaml @@ -10,7 +10,7 @@ parameters: files/25/global.iesopt.param.yaml config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/26_initial_states.iesopt.yaml b/src/assets/examples/26_initial_states.iesopt.yaml index 7f502439..574c23cf 100644 --- a/src/assets/examples/26_initial_states.iesopt.yaml +++ b/src/assets/examples/26_initial_states.iesopt.yaml @@ -6,7 +6,7 @@ parameters: config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/27_piecewise_linear_costs.iesopt.yaml b/src/assets/examples/27_piecewise_linear_costs.iesopt.yaml index 8243a784..c1dc407d 100644 --- a/src/assets/examples/27_piecewise_linear_costs.iesopt.yaml +++ b/src/assets/examples/27_piecewise_linear_costs.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/29_advanced_unit_commitment.iesopt.yaml b/src/assets/examples/29_advanced_unit_commitment.iesopt.yaml index affb9241..8a7ff1f1 100644 --- a/src/assets/examples/29_advanced_unit_commitment.iesopt.yaml +++ b/src/assets/examples/29_advanced_unit_commitment.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/30_representative_snapshots.iesopt.yaml b/src/assets/examples/30_representative_snapshots.iesopt.yaml index d64e43b4..525af1ef 100644 --- a/src/assets/examples/30_representative_snapshots.iesopt.yaml +++ b/src/assets/examples/30_representative_snapshots.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/31_exclusive_operation.iesopt.yaml b/src/assets/examples/31_exclusive_operation.iesopt.yaml index e0a75d3d..87b7ac7c 100644 --- a/src/assets/examples/31_exclusive_operation.iesopt.yaml +++ b/src/assets/examples/31_exclusive_operation.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/32_sos.iesopt.yaml b/src/assets/examples/32_sos.iesopt.yaml index 528670ab..9793eb15 100644 --- a/src/assets/examples/32_sos.iesopt.yaml +++ b/src/assets/examples/32_sos.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/33_benders_investment.iesopt.yaml b/src/assets/examples/33_benders_investment.iesopt.yaml index c64ce7fd..fedd7778 100644 --- a/src/assets/examples/33_benders_investment.iesopt.yaml +++ b/src/assets/examples/33_benders_investment.iesopt.yaml @@ -4,7 +4,7 @@ parameters: config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/34_piecewise_linear_costs.iesopt.yaml b/src/assets/examples/34_piecewise_linear_costs.iesopt.yaml index 48eb3c31..4084f708 100644 --- a/src/assets/examples/34_piecewise_linear_costs.iesopt.yaml +++ b/src/assets/examples/34_piecewise_linear_costs.iesopt.yaml @@ -3,7 +3,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/35_fixed_costs.iesopt.yaml b/src/assets/examples/35_fixed_costs.iesopt.yaml index 09a0ea3b..bb0adbee 100644 --- a/src/assets/examples/35_fixed_costs.iesopt.yaml +++ b/src/assets/examples/35_fixed_costs.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/36_stochastic_investment.iesopt.yaml b/src/assets/examples/36_stochastic_investment.iesopt.yaml index 769082a4..6e7bf9e3 100644 --- a/src/assets/examples/36_stochastic_investment.iesopt.yaml +++ b/src/assets/examples/36_stochastic_investment.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: MILP solver: diff --git a/src/assets/examples/37_certificates.iesopt.yaml b/src/assets/examples/37_certificates.iesopt.yaml index 1b7c765a..6a18197e 100644 --- a/src/assets/examples/37_certificates.iesopt.yaml +++ b/src/assets/examples/37_certificates.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/41_multiobjective_epsilon.iesopt.yaml b/src/assets/examples/41_multiobjective_epsilon.iesopt.yaml index 785748e6..cac2d74c 100644 --- a/src/assets/examples/41_multiobjective_epsilon.iesopt.yaml +++ b/src/assets/examples/41_multiobjective_epsilon.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP+MO snapshots: diff --git a/src/assets/examples/42_multiobjective_lexicographic.iesopt.yaml b/src/assets/examples/42_multiobjective_lexicographic.iesopt.yaml index 2df9f400..ab74df6d 100644 --- a/src/assets/examples/42_multiobjective_lexicographic.iesopt.yaml +++ b/src/assets/examples/42_multiobjective_lexicographic.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP+MO snapshots: diff --git a/src/assets/examples/43_multiobjective_hierarchical.iesopt.yaml b/src/assets/examples/43_multiobjective_hierarchical.iesopt.yaml index 45d1418e..4134868e 100644 --- a/src/assets/examples/43_multiobjective_hierarchical.iesopt.yaml +++ b/src/assets/examples/43_multiobjective_hierarchical.iesopt.yaml @@ -1,7 +1,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP+MO snapshots: diff --git a/src/assets/examples/44_lossy_connections.iesopt.yaml b/src/assets/examples/44_lossy_connections.iesopt.yaml index 05c2cc40..232a0eb3 100644 --- a/src/assets/examples/44_lossy_connections.iesopt.yaml +++ b/src/assets/examples/44_lossy_connections.iesopt.yaml @@ -6,7 +6,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP solver: diff --git a/src/assets/examples/45_result_extraction.iesopt.yaml b/src/assets/examples/45_result_extraction.iesopt.yaml index 79d9cd6b..72c85a23 100644 --- a/src/assets/examples/45_result_extraction.iesopt.yaml +++ b/src/assets/examples/45_result_extraction.iesopt.yaml @@ -4,7 +4,7 @@ config: general: version: - core: 2.0.2 + core: 2.0.3 name: model: ExampleModel45 scenario: SomeScenario_$TIME$ diff --git a/src/assets/examples/46_constants_in_objective.iesopt.yaml b/src/assets/examples/46_constants_in_objective.iesopt.yaml index a5b8cdaf..69c7fc61 100644 --- a/src/assets/examples/46_constants_in_objective.iesopt.yaml +++ b/src/assets/examples/46_constants_in_objective.iesopt.yaml @@ -4,7 +4,7 @@ parameters: config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/47_disable_components.iesopt.yaml b/src/assets/examples/47_disable_components.iesopt.yaml index d28870c3..6712f7c0 100644 --- a/src/assets/examples/47_disable_components.iesopt.yaml +++ b/src/assets/examples/47_disable_components.iesopt.yaml @@ -7,7 +7,7 @@ parameters: config: general: version: - core: 2.0.2 + core: 2.0.3 optimization: problem_type: LP snapshots: diff --git a/src/assets/examples/48_custom_results.iesopt.yaml b/src/assets/examples/48_custom_results.iesopt.yaml index 746e3d59..60a5ed29 100644 --- a/src/assets/examples/48_custom_results.iesopt.yaml +++ b/src/assets/examples/48_custom_results.iesopt.yaml @@ -7,7 +7,7 @@ config: model: CustomResults scenario: SomeScenario_$TIME$ version: - core: 2.0.2 + core: 2.0.3 # ------------------------------------------------------------------------------------------------------------------ # optimization: problem_type: LP From 80f76054de08b0092a97139bf111f9565378d323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Str=C3=B6mer?= Date: Wed, 27 Nov 2024 22:36:53 +0100 Subject: [PATCH 5/5] chore: fix spelling mistake --- src/core/expression.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/expression.jl b/src/core/expression.jl index 14044c53..53b18ae9 100644 --- a/src/core/expression.jl +++ b/src/core/expression.jl @@ -27,10 +27,10 @@ function _string_to_fevalexpr(@nospecialize(str::AbstractString)) str command = join(JuliaSyntax.untokenize.((last_token, token), str)) end - seperator = popfirst!(tokens) # TODO: this is actually just `next_token` - next_token = popfirst!(tokens) # this is the token after the seperator + separator = popfirst!(tokens) # TODO: this is actually just `next_token` + next_token = popfirst!(tokens) # this is the token after the separator - push!(access_order, join(JuliaSyntax.untokenize.((token, seperator, next_token), str))) + push!(access_order, join(JuliaSyntax.untokenize.((token, separator, next_token), str))) write(buf, "__el[$(length(access_order) - starting_access_index + 1)]") last_token = next_token else