From 7a4864b4293047e6e315dafa879e98f6fb48d608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Sat, 27 Dec 2025 13:16:56 +0100 Subject: [PATCH 1/9] Adapt descriptive_names to new elements in EnergyModelsFlex --- NEWS.md | 6 ++++++ Project.toml | 2 +- src/descriptive_names.yml | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index a072daa..bd62ee3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # Release notes +## Version 0.6.3 (2026-01-06) + +### Enhancements + +* Adjust `descriptive_names` to new elements in `EnergyModelsFlex`. + ## Version 0.6.2 (2025-12-18) ### Bugfix diff --git a/Project.toml b/Project.toml index fa48b24..54876ae 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "EnergyModelsGUI" uuid = "737a7361-d3b7-40e9-b1ac-59bee4c5ea2d" -version = "0.6.2" +version = "0.6.3" authors = ["Jon Vegard Venås ", "Dimitri Pinel ", "Magnus Askeland ", "Shweta Tiwari "] [deps] diff --git a/src/descriptive_names.yml b/src/descriptive_names.yml index 1af39ba..32cb17b 100644 --- a/src/descriptive_names.yml +++ b/src/descriptive_names.yml @@ -142,6 +142,13 @@ structures: CCSRetroFit: opex_var: "Variable operating expense per unit of CO₂ captured" + EnergyModelsFlex: + ## links/datastructures.jl + CapacityCostLink: + cap: "Installed capacity" + cap_price: "Price of capacity usage" + cap_price_periods: "The number of sub periods of a year" + variables: # EnergyModelsBase @@ -267,6 +274,8 @@ variables: load_shifted: "Load shifted" sink_surplus_p: "Penalties for surplus of resource" sink_deficit_p: "Penalties for deficits of resource" + cap_cost_sub_period: "Cost over sub periods" + max_cap_use_sub_period: "Maximum capacity usage over sub periods" # Overview of total quantities and their components total: @@ -275,6 +284,8 @@ total: opex_fixed: "Total absolute fixed OPEX" trans_opex_var: "Total absolute variable transmission OPEX" trans_opex_fixed: "Total absolute fixed transmission OPEX" + link_opex_var: "Total absolute variable link OPEX" + link_opex_fixed: "Total absolute fixed link OPEX" capex_fields: cap_capex: "Total absolute CAPEX for investments in the capacity of technologies" stor_level_capex: "Total absolute CAPEX for investments in the capacity of storages" From 518ffe91e616df10b1f24c9edb01108631b45100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Mon, 29 Dec 2025 10:21:44 +0100 Subject: [PATCH 2/9] Fix bug that did not show the backgruond map of the topology when exporting to .svg-format. --- NEWS.md | 4 ++++ src/setup_GUI.jl | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/NEWS.md b/NEWS.md index bd62ee3..791dde3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ ## Version 0.6.3 (2026-01-06) +### Bugfix + +* Fix bug that did not show the backgruond map of the topology when exporting to .svg-format. + ### Enhancements * Adjust `descriptive_names` to new elements in `EnergyModelsFlex`. diff --git a/src/setup_GUI.jl b/src/setup_GUI.jl index ffb2237..f22a762 100644 --- a/src/setup_GUI.jl +++ b/src/setup_GUI.jl @@ -356,17 +356,6 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) boundary_geo_json = GeoJSON.read(read(vars[:map_boundary_file], String)) boundary = GeoMakie.to_multipoly(boundary_geo_json.geometry) end - poly!( - ax, - boundary; - color = :honeydew, - colormap = :dense, - strokecolor = :gray50, - strokewidth = 0.5, - inspectable = false, - depth_shift = 1.0f0 - 2.0f-5, - stroke_depth_shift = 1.0f0 - 3.0f-5, - ) ocean_coords = [(180, -90), (-180, -90), (-180, 90), (180, 90)] poly!( ax, @@ -378,6 +367,17 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) depth_shift = 1.0f0, stroke_depth_shift = 1.0f0 - 1.0f-5, ) + poly!( + ax, + boundary; + color = :honeydew, + colormap = :dense, + strokecolor = :gray50, + strokewidth = 0.5, + inspectable = false, + depth_shift = 1.0f0 - 2.0f-5, + stroke_depth_shift = 1.0f0 - 3.0f-5, + ) else # The design does not use the EnergyModelsGeography package: Create a simple Makie axis ax = Axis( gridlayout_topology_ax[1, 1]; From 8e922864e7160f17d9444fbc9a4a2056109ede67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Mon, 29 Dec 2025 10:22:36 +0100 Subject: [PATCH 3/9] Clean up hack --- src/utils_gen/export_utils.jl | 78 ++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/src/utils_gen/export_utils.jl b/src/utils_gen/export_utils.jl index 777e19f..ae59332 100644 --- a/src/utils_gen/export_utils.jl +++ b/src/utils_gen/export_utils.jl @@ -26,50 +26,60 @@ function merge_svg_strings(svg1, svg2) return header * svg_str1 * svg_str2 * "\n" end +""" + outer_bbox(ax::Makie.AbstractAxis; padding::Number = 0) + +Compute the outer bounding box of the axis `ax` with additional `padding`. +""" +function outer_bbox(ax::Makie.AbstractAxis; padding::Number = 0) + sbb = ax.layoutobservables.suggestedbbox[] + # prot = ax.layoutobservables.protrusions[] + prot = ax.layoutobservables.reporteddimensions[].outer + o = sbb.origin .- (prot.left, prot.bottom) .- padding + w = sbb.widths .+ (prot.left + prot.right, prot.bottom + prot.top) .+ 2 * padding + return Rect2f(o, w) +end + +""" + get_svg(blockscene::Makie.Scene) + +Get the SVG representation of the `blockscene`. +""" +function get_svg(blockscene::Makie.Scene) + svg = mktempdir() do dir + save(joinpath(dir, "output.svg"), blockscene; backend = CairoMakie) + read(joinpath(dir, "output.svg"), String) + end + return svg +end + """ export_svg(ax::Makie.Block, filename::String) Export the `ax` to a .svg file with path given by `filename`. + +!!! note "Temporary approach" + This approach awaits solution from issue https://github.com/MakieOrg/Makie.jl/issues/4500 """ function export_svg( ax::Makie.Block, filename::String; legend::Union{Makie.Legend,Nothing} = nothing, ) - bb = ax.layoutobservables.suggestedbbox[] - protrusions = ax.layoutobservables.reporteddimensions[].outer - - offset = 0 #ax.spinewidth[] / 2 - axis_bb = Rect2f( - bb.origin .- (protrusions.left, protrusions.bottom) .- offset, - bb.widths .+ - (protrusions.left + protrusions.right, protrusions.bottom + protrusions.top) .+ - 2 * offset, + bbox = outer_bbox(ax) + _, sh = ax.blockscene.viewport[].widths + ox, oy = bbox.origin + w, h = bbox.widths + svg_ax = get_svg(ax.blockscene) + svg_legend = isnothing(legend) ? "" : get_svg(legend.blockscene) + svg = merge_svg_strings(svg_ax, svg_legend) + svg = replace( + svg, + r"viewBox=\".*?\"" => "viewBox=\"$ox $(sh - oy - h) $w $h\"", + r"width=\".*?\"" => "width=\"$w\"", + r"height=\".*?\"" => "height=\"$h\"", + count = 3, ) - - pad = 5 - - ws = axis_bb.widths - o = axis_bb.origin - width = "$(ws[1] + 2 * pad)pt" - height = "$(ws[2] + 2 * pad)pt" - - # Temporary hack to fix viewBox for SVG export: - # Based on the default (1920,1080) resolution, set hack such that - # [:results]: when ws[2] is 575.80005 then hack should be 202.442, and - # [:topo]: when ws[2] is 1001.0 then hack should be 953.000 - # Awaiting solution from issue https://github.com/MakieOrg/Makie.jl/issues/4500 - # pad should arguably also be set to 0 when solution is found - hack = 202.442 + (ws[2] - 575.80005) * (953.000 - 202.442) / (1001.0 - 575.80005) - viewBox = "$(o[1] - pad) $(o[2] - hack + ws[2] - pad) $(ws[1] + 2 * pad) $(ws[2] + 2 * pad)" - - svgstring_ax = repr(MIME"image/svg+xml"(), ax.blockscene) - svgstring_legend = - isnothing(legend) ? "" : repr(MIME"image/svg+xml"(), legend.blockscene) - svgstring = merge_svg_strings(svgstring_ax, svgstring_legend) - svgstring = replace(svgstring, r"""(?<=width=")[^"]*(?=")""" => width; count = 1) - svgstring = replace(svgstring, r"""(?<=height=")[^"]*(?=")""" => height; count = 1) - svgstring = replace(svgstring, r"""(?<=viewBox=")[^"]*(?=")""" => viewBox; count = 1) open(filename, "w") do io - print(io, svgstring) + print(io, svg) end return 0 end From 6b87b0061d73f510998887832e80417f0c1e7410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Mon, 29 Dec 2025 17:41:38 +0100 Subject: [PATCH 4/9] Use `Downloads` instead of `HTTP` to download `.geojson` files. This resolves warning and uses a standard julia library that is faster to load. --- NEWS.md | 4 ++++ Project.toml | 4 ++-- src/EnergyModelsGUI.jl | 2 +- src/setup_GUI.jl | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 791dde3..d824de5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,10 @@ * Adjust `descriptive_names` to new elements in `EnergyModelsFlex`. +### Adjustments + +* Use `Downloads` instead of `HTTP` to download `.geojson` files. This resolves warning and uses a standard julia library that is faster to load. + ## Version 0.6.2 (2025-12-18) ### Bugfix diff --git a/Project.toml b/Project.toml index 54876ae..fce1ed7 100644 --- a/Project.toml +++ b/Project.toml @@ -9,13 +9,13 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50" EnergyModelsInvestments = "fca3f8eb-b383-437d-8e7b-aac76bb2004f" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" GeoJSON = "61d90e0f-e114-555e-ac52-39dfb47a3ef9" GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6" -HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" @@ -40,6 +40,7 @@ CairoMakie = "0.15" Colors = "0.13" DataFrames = "1" Dates = "1" +Downloads = "1" EnergyModelsBase = "0.9" EnergyModelsGeography = "0.11.3" EnergyModelsInvestments = "0.8" @@ -47,7 +48,6 @@ FileIO = "1" GLMakie = "0.13" GeoJSON = "0.8" GeoMakie = "0.7.16" -HTTP = "1.10" ImageMagick = "1" InteractiveUtils = "1" IntervalSets = "<0.7.12" diff --git a/src/EnergyModelsGUI.jl b/src/EnergyModelsGUI.jl index 3c65f8d..dd678e7 100644 --- a/src/EnergyModelsGUI.jl +++ b/src/EnergyModelsGUI.jl @@ -48,7 +48,7 @@ using DataFrames using GeoMakie, GeoJSON # Needed to download the .json file for geographical coastlines -using HTTP +using Downloads # Use PrettyTables to enable printing data to the REPL using PrettyTables diff --git a/src/setup_GUI.jl b/src/setup_GUI.jl index f22a762..404344d 100644 --- a/src/setup_GUI.jl +++ b/src/setup_GUI.jl @@ -329,8 +329,8 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) alignmode = Inside(), ) - if isempty(vars[:map_boundary_file]) - # Plot coast lines + # Plot coast lines + if isempty(vars[:map_boundary_file]) # Use default coast lines if vars[:coarse_coast_lines] # Use low resolution coast lines boundary = GeoMakie.land() else # Use high resolution coast lines @@ -343,7 +343,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) # Download the file if it doesn't exist in the temporary directory if !isfile(local_file_path) - HTTP.download(url, local_file_path) + download(url, local_file_path) end # Now read the data from the file @@ -352,7 +352,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) # Create GeoMakie plotable object boundary = GeoMakie.to_multipoly(boundary_geo_json.geometry) end - else + else # Use user-provided coast lines boundary_geo_json = GeoJSON.read(read(vars[:map_boundary_file], String)) boundary = GeoMakie.to_multipoly(boundary_geo_json.geometry) end From dcca64c19c7bedcae63406470d6e94218fd27a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Wed, 31 Dec 2025 03:12:39 +0100 Subject: [PATCH 5/9] Cleaned up `test/case7.jl` --- NEWS.md | 1 + test/case7.jl | 47 +++++++++++++++++++++++++---------------- test/inputfiles/0.dat | 24 --------------------- test/inputfiles/0_1.dat | 24 --------------------- test/inputfiles/1.dat | 24 --------------------- test/inputfiles/10.dat | 24 --------------------- test/inputfiles/100.dat | 24 --------------------- 7 files changed, 30 insertions(+), 138 deletions(-) delete mode 100644 test/inputfiles/0.dat delete mode 100644 test/inputfiles/0_1.dat delete mode 100644 test/inputfiles/1.dat delete mode 100644 test/inputfiles/10.dat delete mode 100644 test/inputfiles/100.dat diff --git a/NEWS.md b/NEWS.md index d824de5..2b186a2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,6 +13,7 @@ ### Adjustments * Use `Downloads` instead of `HTTP` to download `.geojson` files. This resolves warning and uses a standard julia library that is faster to load. +* Cleaned up `test/case7.jl`. ## Version 0.6.2 (2025-12-18) diff --git a/test/case7.jl b/test/case7.jl index 1e51207..f92eab7 100644 --- a/test/case7.jl +++ b/test/case7.jl @@ -72,7 +72,10 @@ function read_data() lat = [xy[2] for xy ∈ coordinates] # Create the individual areas and transmission modes - areas = [RefArea(i, area_ids[i], lon[i], lat[i], an[i]) for i ∈ eachindex(area_ids)] + areas = [ + RefArea("area" * string(i), area_ids[i], lon[i], lat[i], an[i]) for + i ∈ eachindex(area_ids) + ] # Set parameters for the power line capacity, lossRatio = get_cable_data() @@ -244,27 +247,35 @@ function get_sub_system_data_case7(a_id, products, T) # Create links between nodes links = [ - Direct(1, el_busbar_11125, el_1, Linear()), - Direct(2, el_busbar_11125, heat_generator, Linear()), - Direct(3, el_busbar_11125, water_heater, Linear()), - Direct(4, heat_generator, heating_1, Linear()), - Direct(5, water_heater, hot_water_1, Linear()), - Direct(6, el_busbar_11125, heat_pump, Linear()), - Direct(7, heat_pump, heating_1, Linear()), - Direct(8, waste_heat_data_center, heat_pump, Linear()), + Direct("El busbar_11125 - El 1", el_busbar_11125, el_1, Linear()), + Direct( + "El busbar_11125 - Heat generator", + el_busbar_11125, + heat_generator, + Linear(), + ), + Direct( + "El busbar_11125 - Water heater", + el_busbar_11125, + water_heater, + Linear(), + ), + Direct("Heat generator - Heating 1", heat_generator, heating_1, Linear()), + Direct("Water heater - Hot water 1", water_heater, hot_water_1, Linear()), + Direct("El busbar_11125 - Heat pump", el_busbar_11125, heat_pump, Linear()), + Direct("Heat pump - Heating 1", heat_pump, heating_1, Linear()), + Direct( + "Waste heat data center - Heat pump", + waste_heat_data_center, + heat_pump, + Linear(), + ), ] elseif a_id == "Area 2" # Load the electricity cost from file El_cost_file = readlines(inputFolder * raw"/el cost.dat") El_cost = [parse(Float64, line) for line ∈ El_cost_file] # In NOK/MWh - # Load the power supply capacity from file - max_outtake_file = readlines(inputFolder * raw"/10.dat") - max_outtake = [parse(Float64, line) for line ∈ max_outtake_file] # In MW - max_waste_outtake = [ - i > 1 ? FixedProfile(0.0) : FixedProfile(0.0) for i ∈ 1:(T.len) - ] # Make Waste supply available only from 2030 - # Construct nodes el_busbar_11124 = GeoAvailability( "El busbar_11124", # Node id @@ -272,7 +283,7 @@ function get_sub_system_data_case7(a_id, products, T) ) power_supply = RefSource( "Power supply", # Node id - OperationalProfile(max_outtake), # Cap, installed capacity + FixedProfile(10), # Cap, installed capacity OperationalProfile(El_cost), # Variable operational cost per unit produced FixedProfile(0), # Fixed operational cost per unit produced Dict(Power => 1), # The generated resources with conversion value 1 @@ -288,7 +299,7 @@ function get_sub_system_data_case7(a_id, products, T) EV_charger_change_factors = [1, El_change_factor[3] / El_change_factor[2]] # Since the EV_charger is introduced in 2030, the El_change_factor is shifted such that the initial profile is not scaled (starting at the second strategic period) # Since the EV_charger is introduced in 2030, the El_change_factor is shifted such that the initial profile is not scaled (starting at the second strategic period) EV_charger_demand = [ if i == 1 - OperationalProfile(0.0 * ones(24)) + FixedProfile(0.0) else OperationalProfile( EV_charger_demand_day * EV_charger_change_factors[i-1], diff --git a/test/inputfiles/0.dat b/test/inputfiles/0.dat deleted file mode 100644 index f8ac723..0000000 --- a/test/inputfiles/0.dat +++ /dev/null @@ -1,24 +0,0 @@ -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 -0.000000 diff --git a/test/inputfiles/0_1.dat b/test/inputfiles/0_1.dat deleted file mode 100644 index 12a357f..0000000 --- a/test/inputfiles/0_1.dat +++ /dev/null @@ -1,24 +0,0 @@ -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 -0.100000 diff --git a/test/inputfiles/1.dat b/test/inputfiles/1.dat deleted file mode 100644 index ab55b80..0000000 --- a/test/inputfiles/1.dat +++ /dev/null @@ -1,24 +0,0 @@ -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 diff --git a/test/inputfiles/10.dat b/test/inputfiles/10.dat deleted file mode 100644 index 58bcd60..0000000 --- a/test/inputfiles/10.dat +++ /dev/null @@ -1,24 +0,0 @@ -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 -10.000000 diff --git a/test/inputfiles/100.dat b/test/inputfiles/100.dat deleted file mode 100644 index fd178c7..0000000 --- a/test/inputfiles/100.dat +++ /dev/null @@ -1,24 +0,0 @@ -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 -100.000000 From d121516448cc6f5c3aae5dc0cd100829ddedce4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Wed, 31 Dec 2025 04:08:02 +0100 Subject: [PATCH 6/9] Add a white background to `.svg`-files. --- src/utils_gen/export_utils.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils_gen/export_utils.jl b/src/utils_gen/export_utils.jl index ae59332..ee4ddde 100644 --- a/src/utils_gen/export_utils.jl +++ b/src/utils_gen/export_utils.jl @@ -78,6 +78,14 @@ function export_svg( r"height=\".*?\"" => "height=\"$h\"", count = 3, ) + + # Add white background + svg_str1, header = extract_svg(svg) + svg = + header * + """ """ * + svg_str1 * "\n" + open(filename, "w") do io print(io, svg) end From e54bdd364d23e37dc104970a9f39b2732bfd1f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Vegard=20Ven=C3=A5s?= Date: Wed, 31 Dec 2025 04:52:59 +0100 Subject: [PATCH 7/9] Fix introduced bugs --- NEWS.md | 1 + src/setup_GUI.jl | 2 +- test/test_interactivity.jl | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2b186a2..b407556 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,7 @@ * Use `Downloads` instead of `HTTP` to download `.geojson` files. This resolves warning and uses a standard julia library that is faster to load. * Cleaned up `test/case7.jl`. +* Add a white background to `.svg`-files. ## Version 0.6.2 (2025-12-18) diff --git a/src/setup_GUI.jl b/src/setup_GUI.jl index 404344d..77a3c26 100644 --- a/src/setup_GUI.jl +++ b/src/setup_GUI.jl @@ -343,7 +343,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) # Download the file if it doesn't exist in the temporary directory if !isfile(local_file_path) - download(url, local_file_path) + Downloads.download(url, local_file_path) end # Now read the data from the file diff --git a/test/test_interactivity.jl b/test/test_interactivity.jl index 6ac3d2d..3e6b991 100644 --- a/test/test_interactivity.jl +++ b/test/test_interactivity.jl @@ -5,10 +5,10 @@ root_design = get_root_design(gui) components = get_components(root_design) connections = get_connections(root_design) -area1 = get_component(components, 1) -area2 = get_component(components, 2) -area3 = get_component(components, 3) -area4 = get_component(components, 4) +area1 = get_component(components, "area1") +area2 = get_component(components, "area2") +area3 = get_component(components, "area3") +area4 = get_component(components, "area4") time_menu = get_menu(gui, :time) available_data_menu = get_menu(gui, :available_data) From 367574fa2433ba1675fb0dcc290fa509d0c03d2e Mon Sep 17 00:00:00 2001 From: Julian Straus Date: Tue, 13 Jan 2026 11:19:05 +0100 Subject: [PATCH 8/9] Adjustments based on review comments --- NEWS.md | 4 ++-- src/descriptive_names.yml | 24 ++++++++++++------------ src/utils_gen/export_utils.jl | 1 - 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index b407556..2fe0db8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ ### Bugfix -* Fix bug that did not show the backgruond map of the topology when exporting to .svg-format. +* Fix bug that did not show the background map of the topology when exporting to .svg-format. ### Enhancements @@ -77,7 +77,7 @@ ### Enhancements -* Use `Float32` instead of `Number`/`Real`/`Float64` for coordinate related computations in topo (also `Point2f` instead of `Tuple` and `Vector`). +* Use `Float32` instead of `Number`/`Real`/`Float64` for coordinate related computations in topo (also `Point2f` instead of `Tuple` and `Vector`). * Remove redundant `notify_component` function and `Observable`s (use the `@lift` macro instead). * Improve performance of updates to `ax_info`. * Add missing tests for show-function on the types `AbstractSystem` and `ProcInvData`, and improve code structure. diff --git a/src/descriptive_names.yml b/src/descriptive_names.yml index 32cb17b..7cbc5de 100644 --- a/src/descriptive_names.yml +++ b/src/descriptive_names.yml @@ -1,4 +1,4 @@ -# This file contains description of EMX element fields (and potential sub-fields) and variables +# This file contains description of EMX element fields (and potential sub-fields) and variables # with fields of type TimeStruct.TimeProfile and fields that cannot be inherited # from supertypes. structures: @@ -86,7 +86,7 @@ structures: HydroGenerator: cap: "Installed discharge or power capacity" - + HydroPump: cap: "Installed pumping capacity" @@ -147,7 +147,7 @@ structures: CapacityCostLink: cap: "Installed capacity" cap_price: "Price of capacity usage" - cap_price_periods: "The number of sub periods of a year" + cap_price_periods: "The number of sub periods in an investment period" variables: @@ -191,7 +191,7 @@ variables: linepack_stor_level: "Storage level in linepack" emissions_trans: "Emissions of a transmission mode" - # EnergyModelsInvestment + # EnergyModelsInvestment cap_capex: "Absolute CAPEX for investments in the capacity of a technology" cap_invest_b: "Binary indicator of capacity investments" cap_remove_b: "Binary indicator of capacity investments removal" @@ -269,13 +269,13 @@ variables: # EnergyModelsFlex input_frac_strat: "Input resource fraction" - load_shift_from: "Load shift from" - load_shift_to: "Load shift to" + load_shift_from: "Load shift from" + load_shift_to: "Load shift to" load_shifted: "Load shifted" - sink_surplus_p: "Penalties for surplus of resource" - sink_deficit_p: "Penalties for deficits of resource" - cap_cost_sub_period: "Cost over sub periods" - max_cap_use_sub_period: "Maximum capacity usage over sub periods" + sink_surplus_p: "Penalties for surplus of resource" + sink_deficit_p: "Penalties for deficits of resource" + ccl_cap_use_cost: "Cost over sub periods" + ccl_cap_use_max: "Maximum capacity usage over sub periods" # Overview of total quantities and their components total: @@ -284,8 +284,8 @@ total: opex_fixed: "Total absolute fixed OPEX" trans_opex_var: "Total absolute variable transmission OPEX" trans_opex_fixed: "Total absolute fixed transmission OPEX" - link_opex_var: "Total absolute variable link OPEX" - link_opex_fixed: "Total absolute fixed link OPEX" + link_opex_var: "Total absolute variable link OPEX" + link_opex_fixed: "Total absolute fixed link OPEX" capex_fields: cap_capex: "Total absolute CAPEX for investments in the capacity of technologies" stor_level_capex: "Total absolute CAPEX for investments in the capacity of storages" diff --git a/src/utils_gen/export_utils.jl b/src/utils_gen/export_utils.jl index ee4ddde..52368d9 100644 --- a/src/utils_gen/export_utils.jl +++ b/src/utils_gen/export_utils.jl @@ -33,7 +33,6 @@ Compute the outer bounding box of the axis `ax` with additional `padding`. """ function outer_bbox(ax::Makie.AbstractAxis; padding::Number = 0) sbb = ax.layoutobservables.suggestedbbox[] - # prot = ax.layoutobservables.protrusions[] prot = ax.layoutobservables.reporteddimensions[].outer o = sbb.origin .- (prot.left, prot.bottom) .- padding w = sbb.widths .+ (prot.left + prot.right, prot.bottom + prot.top) .+ 2 * padding From b0ee602d65c45ffefa050de85d9e99eb664be92b Mon Sep 17 00:00:00 2001 From: Julian Straus Date: Tue, 13 Jan 2026 14:21:16 +0100 Subject: [PATCH 9/9] Last update to NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 2fe0db8..46264b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # Release notes -## Version 0.6.3 (2026-01-06) +## Version 0.6.3 (2026-01-13) ### Bugfix