diff --git a/NEWS.md b/NEWS.md index 8c4a19d..5c3cec2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,23 @@ # Release notes +## Version 0.5.13 (2025-06-02) + +### Bugfix + +* Fix bug when `length(get_products(system)) == length(id_to_color_map)` but when `get_products(system)` is not a subset of `keys(id_to_color_map)`. This case did not expand `id_to_color_map` correctly. +* Add missing description of the `case_name` option in the `GUI`-function. +* Add the `EnergyModelsGUI` package in the `Project.toml` file in the examples folder. + +### Enhancement + +* Added more descriptive names for `EnergyModelsHeat` and `EnergyModelsHydrogen` and add a colors for the `HeatLT` and `HeatHT` resources. + +### Adjustment +* Order the colors (by id) in the Resources legend. +* Move boundaries for countries just above the ocean layer. +* Fix default placements of the nodes in a uniform circle (when coordinates are not provided). +* Only create the design-folder if needed. + ## Version 0.5.12 (2025-03-09) ### Enhancement diff --git a/Project.toml b/Project.toml index fc0727e..cb72484 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "EnergyModelsGUI" uuid = "737a7361-d3b7-40e9-b1ac-59bee4c5ea2d" authors = ["Jon Vegard Venås ", "Magnus Askeland ", "Shweta Tiwari "] -version = "0.5.12" +version = "0.5.13" [deps] CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" diff --git a/examples/Project.toml b/examples/Project.toml index 36df707..77f1014 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -1,5 +1,6 @@ [deps] EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50" +EnergyModelsGUI = "737a7361-d3b7-40e9-b1ac-59bee4c5ea2d" EnergyModelsGeography = "3f775d88-a4da-46c4-a2cc-aa9f16db6708" EnergyModelsInvestments = "fca3f8eb-b383-437d-8e7b-aac76bb2004f" EnergyModelsRenewableProducers = "b007c34f-ba52-4995-ba37-fffe79fbde35" diff --git a/src/colors.yml b/src/colors.yml index b089ab9..45b25c0 100644 --- a/src/colors.yml +++ b/src/colors.yml @@ -17,4 +17,6 @@ ResourceEmit: "#606060" # gray CO2: "#606060" # gray CO₂: "#606060" # gray Coal: "#6D392E" # brown -Water: "#bfefff" # sky blue \ No newline at end of file +Water: "#bfefff" # sky blue +HeatLT: "#fbdfb0" # :navajowhite +HeatHT: "#e78582" # :lightcoral \ No newline at end of file diff --git a/src/descriptive_names.yml b/src/descriptive_names.yml index 3ca4c33..02b0075 100644 --- a/src/descriptive_names.yml +++ b/src/descriptive_names.yml @@ -1,4 +1,4 @@ -# This file contains description of EMX-structures and variables +# This file contains description of EMX element fields (and potential sub-fields) and variables # with fields of type TimeStruct.TimeProfile structures: # EnergyModelsBase @@ -23,103 +23,61 @@ structures: opex_var: "Relative variable operating expense per energy unit" RefSource: - id: "Name/identifier of the node" cap: "Installed capacity" opex_var: "Relative variable operating expense per energy unit produced" opex_fixed: "Relative fixed operating expense per installed capacity" - output: "Output resources with conversion value" - data: "Additional data" RefNetworkNode: - id: "Name/identifier of the node" cap: "Installed capacity" opex_var: "Relative variable operating expense per energy unit produced" opex_fixed: "Relative fixed operating expense per installed capacity" - input: "Input resources with conversion value" - output: "Output resources with conversion value" - data: "Additional data" - - RefStorage: - id: "Name/identifier of the node" - charge: "Charging parameters of the Storage node" - level: "Level parameters of the Storage node" - stor_res: "Stored resource" - input: "Input resources with conversion value" - output: "Output resources with conversion value (relevant for linking and the stored resource)" - data: "Additional data" RefSink: - id: "Name/identifier of the node" cap: "Demand" penalty: surplus: "Penalties for surplus" deficit: "Penalties for deficits" - input: "Input resources with conversion value" - data: "Additional data" - ## EnergyModelsGeography - # mode.jl + # EnergyModelsGeography + ## mode.jl RefDynamic: - id: "Name/identifier of the transmission mode" - resource: "Transported resource" trans_cap: "Capacity of the transmission mode" trans_loss: "Relative loss of the transported resource during transmission" opex_var: "Relative variable operating expense per energy unit transported" opex_fixed: "Relative fixed operating expense per installed capacity" - directions: "Number of directions the resource can be transported" RefStatic: - id: "Name/identifier of the transmission mode" - resource: "Resource that is transported" trans_cap: "Capacity of the transmission mode" trans_loss: "Relative loss of the transported resource during transmission" opex_var: "Relative variable operating expense per energy unit transported" opex_fixed: "Relative fixed operating expense per installed capacity" - directions: "Number of directions the resource can be transported" - data: "Additional data" PipeSimple: - id: "Identifier used in printed output" - inlet: "Resource going into transmission" - outlet: "Resource going out of the outlet of the transmission" - consuming: "Resource the transmission consumes by operating" consumption_rate: "Rate at which the resource is consumed, as a ratio of the volume of the resource going into the inlet" trans_cap: "Capacity of the transmission mode" trans_loss: "Relative loss of the transported resource during transmission" opex_var: "Relative variable operating expense per energy unit transported" opex_fixed: "Relative fixed operating expense per installed capacity" - directions: "Specifies that the pipeline is unidirectional by default" - data: "Additional data" PipeLinepackSimple: - id: "Identifier used in printed output" - inlet: "Resource going into transmission" - outlet: "Resource going out of the outlet of the transmission" - consuming: "Resource the transmission consumes by operating" consumption_rate: "Rate at which the resource is consumed, as a ratio of the volume of the resource going into the inlet" trans_cap: "Capacity of the transmission mode" trans_loss: "Relative loss of the transported resource during transmission" opex_var: "Relative variable operating expense per energy unit transported" opex_fixed: "Relative fixed operating expense per installed capacity" - energy_share: "Storage energy capacity relative to pipeline capacity" - directions: "Specifies that the pipeline is unidirectional by default" - ## EnergyModelsInvestment - # investment_data.jl + # EnergyModelsInvestment + ## investment_data.jl NoStartInvData: capex: "Capital costs for investing in a capacity" max_inst: "Maximum installed capacity in a strategic period" - inv_mode: "Chosen investment mode for the technology" - life_mode: "Chosen lfetime mode for the technology" StartInvData: capex: "Capital costs for investing in a capacity" max_inst: "Maximum installed capacity in a strategic period" initial: "Initial capacity in the first strategic period" - inv_mode: "Chosen investment mode for the technology" - life_mode: "Chosen lfetime mode for the technology" - # investment_mode.jl + ## investment_mode.jl FixedInvestment: cap: "Capacity used for the fixed investments" @@ -142,7 +100,7 @@ structures: min_add: "Minimum added capacity in a strategic period" capex_offset: "Offset for the CAPEX in a strategic period" - # lifetime_mode.jl + ## lifetime_mode.jl StudyLife: lifetime: "Chosen lifetime of the technology" @@ -152,200 +110,250 @@ structures: RollingLife: lifetime: "Chosen lifetime of the technology" - ## EnergyModelsRenewableProducers + # EnergyModelsRenewableProducers + ## datastructures.jl NonDisRES: - id: "Name/identifier of the node" - cap: "Installed capacity" - profile: "Power production profile as a ratio of installed capacity" - opex_var: "Relative variable operating expense per energy unit produced" - opex_fixed: "Relative fixed operating expense per installed capacity" - output: "Generated resources, normally Power" - data: "Additional data" + cap: "Installed capacity" + profile: "Power production profile as a ratio of installed capacity" + opex_var: "Relative variable operating expense per energy unit produced" + opex_fixed: "Relative fixed operating expense per installed capacity" HydroStor: - id: "Name/identifier of the node" - level: "Level parameters of the HydroStor node" - discharge: "Discharging parameters of the HydroStor node" - level_init: "Initial stored energy in the dam" - level_inflow: "Inflow of power per operational period" - level_min: "Minimum fraction of the reservoir capacity required" - stor_res: "Stored resource" - input: "Input resources" - output: "Output resources" - data: "Additional data" + level_init: "Initial stored energy in the dam" + level_inflow: "Inflow of power per operational period" + level_min: "Minimum fraction of the reservoir capacity required" PumpedHydroStor: - id: "Name/identifier of the node" - charge: "Charging parameters of the PumpedHydroStor node" - level: "Level parameters of the PumpedHydroStor node" - discharge: "Discharging parameters of the PumpedHydroStor node" - level_init: "Initial stored energy in the dam" - level_inflow: "Inflow of power per operational period" - level_min: "Minimum fraction of the reservoir capacity required" - stor_res: "Stored resource" - input: "Input resources" - output: "Output resources" - data: "Additional data" + level_init: "Initial stored energy in the dam" + level_inflow: "Inflow of power per operational period" + level_min: "Minimum fraction of the reservoir capacity required" + + ScheduleConstraint: + value: "The constraint value not to be violated" + flag: "Boolean value indicating if the constraint is active" + penalty: "Penalty for violating the constraint" HydroReservoir: - id: "Name/identifier of the node" - vol: "Storage volume parameters of the HydroReservoir node" - vol_inflow: "Water inflow to the reservoir" - stor_res: "Stored resource" - data: "Additional data" + vol_inflow: "Water inflow to the reservoir" HydroGate: - id: "Name/identifier of the node" - cap: "Installed discharge capacity" - opex_var: "Variable operational costs per water flow" - opex_fixed: "Fixed operational costs" - resource: "Water resource type" - data: "Additional data" + cap: "Installed discharge capacity" + opex_var: "Variable operational costs per water flow" + opex_fixed: "Fixed operational costs" HydroGenerator: - id: "Name/identifier of the node" - cap: "Installed discharge or power capacity" - pq_curve: "Relationship between power and discharge" - opex_var: "Variable operational costs per energy unit produced" - opex_fixed: "Fixed operational costs" - electricity_resource: "Electricity resource generated as output" - water_resource: "Water resource taken as input and discharged as output" - data: "Additional data" + cap: "Installed discharge or power capacity" + opex_var: "Variable operational costs per energy unit produced" + opex_fixed: "Fixed operational costs" HydroPump: - id: "Name/identifier of the node" - cap: "Installed pumping capacity" - pq_curve: "Relationship between power and water pumping" - opex_var: "Variable operational costs per energy unit produced" - opex_fixed: "Fixed operational costs" - electricity_resource: "Electricity resource taken as input (consumed)" - water_resource: "Water resource taken as input and discharged as output" - data: "Additional data" - - Battery: - id: "Name/identifier of the node" - charge: "Charging parameters of the Battery node" - level: "Level parameters of the Battery node" - discharge: "Discharging parameters of the Battery node" - stor_res: "Stored resource" - input: "Input resources with efficiency values" - output: "Output resources with efficiency values" - battery_life: "Battery lifetime model" - data: "Additional data" - - ReserveBattery: - id: "Name/identifier of the node" - charge: "Charging parameters of the ReserveBattery node" - level: "Level parameters of the ReserveBattery node" - discharge: "Discharging parameters of the ReserveBattery node" - stor_res: "Stored resource" - input: "Input resources with efficiency values" - output: "Output resources with efficiency values" - battery_life: "Battery lifetime model" - reserve_up: "Resources used as reserve for adding capacity" - reserve_down: "Resources used as reserve for removing capacity" - data: "Additional data" + cap: "Installed pumping capacity" + opex_var: "Variable operational costs per energy unit produced" + opex_fixed: "Fixed operational costs" + + CycleLife: + stack_cost: "Relative cost for replacing a battery stack" + + # EnergyModelsHeat + ## link.jl + DHPipe: + cap: "Heat transport capacity of the pipe" + t_ground: "Ground temperature in °C" + + ## node.jl + HeatPump: + cap: "Installed capacity" + t_source: "Heat source temperature" + t_sink: "Heat sink temperature" + eff_carnot: "Carnot Efficiency" + opex_var: "Variable operating expense per energy unit produced" + opex_fixed: "Fixed operating expense per installed capacity" + + HeatExchanger: + cap: "Installed capacity" + opex_var: "Variable operating expense per energy unit produced" + opex_fixed: "Fixed operating expense per installed capacity" + + DirectHeatUpgrade: + cap: "Installed capacity" + opex_var: "Variable operating expense per energy unit produced" + opex_fixed: "Fixed operating expense per installed capacity" + + ## resource.jl + ResourceHeat: + t_supply: "Supply temperature in °C" + t_return: "Return temperature in °C" + + # EnergyModelsHydrogen + ## node.jl + Electrolyzer: + cap: "Installed capacity" + opex_var: "Variable operating expense per capacity used" + opex_fixed: "Fixed operating expense per installed capacity" + stack_replacement_cost: "Replacement cost of electrolyzer stacks" + + SimpleElectrolyzer: + cap: "Installed capacity" + opex_var: "Variable operating expense per capacity used" + opex_fixed: "Fixed operating expense per installed capacity" + stack_replacement_cost: "Replacement cost of electrolyzer stacks" + + CommitParameters: + opex: "Operating cost per installed capacity and operational duration" + time: "Minimum time node must remain in a state before transitioning" + + RampBi: + up: "Maximum positive rate of change of a node" + down: "Maximum negative rate of change of a node" + + RampUp: + up: "Maximum positive rate of change of a node" + + RampDown: + down: "Maximum negative rate of change of a node" + + Reformer: + cap: "Installed capacity" + opex_var: "Variable operating expense per capacity usage" + opex_fixed: "Fixed operating expense per installed capacity" + + # EnergyModelsCO2 + CO2Source: + cap: "Installed capacity" + opex_var: "Variable operating expense per energy unit produced" + opex_fixed: "Fixed operating expense" + + RefNetworkNodeRetrofit: + cap: "Installed capacity" + opex_var: "Variable operating expense per energy unit produced" + opex_fixed: "Fixed operating expense" + + CCSRetroFit: + cap: "Installed capacity" + opex_var: "Variable operating expense per unit of CO₂ captured" + opex_fixed: "Fixed operating expense" + variables: - ## EnergyModelsBase - cap_use: "Absolute capacity utilization" - cap_inst: "Installed capacity" - stor_level: "Storage level at end of operational period" - stor_level_inst: "Installed storage capacity" - stor_level_Δ_op: "Storage level change in an operational period" - stor_level_Δ_rp: "Storage level change in a representative period" - stor_charge_use: "Absolute storage charging utilization" - stor_charge_inst: "Installed charging capacity" - stor_discharge_use: "Absolute storage discharging utilization" - stor_discharge_inst: "Installed discharging capacity" - flow_in: "Input flowrate" - flow_out: "Output flowrate" - link_in: "Link input" - link_out: "Link output" - emissions_node: "Emission of a node" - emissions_total: "Total strategic emissions" - emissions_strategic: "Total emissions" - opex_var: "Absolute variable operating expenses" - opex_fixed: "Absolute fixed operating expenses" - sink_surplus: "Surplus delivered to a sink, i.e., oversatisfied demand" - sink_deficit: "Deficit in a sink, i.e., not satisfied demand" - link_cap_inst: "Installed capacity" - - ## EnergyModelsGeography - area_exchange: "Area exchange" - trans_opex_var: "Absolute variable transmission operating expenses" - trans_opex_fixed: "Absolute fixed transmission operating expenses" - trans_cap: "Transmission capacity usage" - trans_in: "Inlet flow to a transmission mode" - trans_out: "Outlet flow from a transmission mode" - trans_loss: "Loss during transmission" - trans_neg: "Negative loss during transmission" - trans_pos: "Positive loss during transmission" - linepack_stor_level: "Storage level in linepack" - - ## 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" - cap_current: "Installed capacity in each strategic period" - cap_add: "Added capacity" - cap_rem: "Removed capacity" - stor_level_capex: "Absolute CAPEX for investments in the capacity of a storage" - stor_level_invest_b: "Binary indicator of capacity investments" - stor_level_remove_b: "Binary indicator of capacity investments removal" - stor_level_current: "Installed storage capacity in each strategic period" - stor_level_add: "Added storage capacity" - stor_level_rem: "Removed storage capacity" - stor_charge_capex: "Absolute CAPEX for investments in the charging rate of a storage" - stor_charge_invest_b: "Binary indicator of investments in charging rate" - stor_charge_remove_b: "Binary indicator of investments in charging rate removal" - stor_charge_current: "Installed charging rate for storage in each strategic period" - stor_charge_add: "Added charging rate" - stor_charge_rem: "Removed charging rate" - stor_discharge_capex: "Absolute CAPEX for investments in the discharging rate of a storage" - stor_discharge_invest_b: "Binary indicator of investments in discharging rate" - stor_discharge_remove_b: "Binary indicator of investments in discharging rate removal" - stor_discharge_current: "Installed rate for storage in each strategic period" - stor_discharge_add: "Added discharging rate" - stor_discharge_rem: "Removed rdischarging ate" - trans_cap_capex: "Absolute CAPEX for investments in the capacity of a transmission mode" - trans_cap_invest_b: "Binary indicator of investments in transmission capacity" - trans_cap_remove_b: "Binary indicator of investments in transmission capacity removal" - trans_cap_current: "Installed capacity for each strategic period" - trans_cap_add: "Added capacity" - trans_cap_rem: "Removed capacity" - - ## EnergyModelsRenewableProducers - curtailment: "Curtailment of a non-dispatchable energy source" - hydro_spill: "Spilled water (not producing energy)" - gate_penalty_up: "Penalty variable for exceeding hydro gate constraints" - gate_penalty_down: "Penalty variable for not meeting hydro gate constraints" - rsv_penalty_up: "Penalty variable for exceeding hydro reservoir constraints" - rsv_penalty_down: "Penalty variable for not meeting hydro reservoir constraints" - gen_penalty_up: "Penalty variable for exceeding hydro unit generation constraints" - gen_penalty_down: "Penalty variable for not meeting hydro unit generation constraints" - discharge_segment: "Discharge segment variable for hydro unit discharge capacity" - bat_prev_use: "Accumulated charge effect of a battery up to an operational period" - bat_prev_use_sp: "Accumulated charge effect of a battery up to an investment period" - bat_use_sp: "Accumulated charge effect of a battery in an investment period" - bat_use_rp: "Accumulated charge effect of a battery in a representative period" - bat_stack_replace_b: "Binary variable for identifying battery stack replacement" - bat_res_up: "Upwards reserve of battery storage" - bat_res_down: "Downwards reserve of battery storage" + # EnergyModelsBase + cap_use: "Absolute capacity utilization" + cap_inst: "Installed capacity" + stor_level: "Storage level at end of operational period" + stor_level_inst: "Installed storage capacity" + stor_level_Δ_op: "Storage level change in an operational period" + stor_level_Δ_rp: "Storage level change in a representative period" + stor_charge_use: "Absolute storage charging utilization" + stor_charge_inst: "Installed charging capacity" + stor_discharge_use: "Absolute storage discharging utilization" + stor_discharge_inst: "Installed discharging capacity" + flow_in: "Input flowrate" + flow_out: "Output flowrate" + link_in: "Link input" + link_out: "Link output" + emissions_node: "Emission of a node" + emissions_total: "Total strategic emissions" + emissions_strategic: "Total emissions" + opex_var: "Absolute variable operating expenses" + opex_fixed: "Absolute fixed operating expenses" + sink_surplus: "Surplus delivered to a sink, i.e., oversatisfied demand" + sink_deficit: "Deficit in a sink, i.e., not satisfied demand" + link_cap_inst: "Installed capacity" + + # EnergyModelsGeography + area_exchange: "Area exchange" + trans_opex_var: "Absolute variable transmission operating expenses" + trans_opex_fixed: "Absolute fixed transmission operating expenses" + trans_cap: "Transmission capacity usage" + trans_in: "Inlet flow to a transmission mode" + trans_out: "Outlet flow from a transmission mode" + trans_loss: "Loss during transmission" + trans_neg: "Negative loss during transmission" + trans_pos: "Positive loss during transmission" + linepack_stor_level: "Storage level in linepack" + + # 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" + cap_current: "Installed capacity in each strategic period" + cap_add: "Added capacity" + cap_rem: "Removed capacity" + stor_level_capex: "Absolute CAPEX for investments in the capacity of a storage" + stor_level_invest_b: "Binary indicator of capacity investments" + stor_level_remove_b: "Binary indicator of capacity investments removal" + stor_level_current: "Installed storage capacity in each strategic period" + stor_level_add: "Added storage capacity" + stor_level_rem: "Removed storage capacity" + stor_charge_capex: "Absolute CAPEX for investments in the charging rate of a storage" + stor_charge_invest_b: "Binary indicator of investments in charging rate" + stor_charge_remove_b: "Binary indicator of investments in charging rate removal" + stor_charge_current: "Installed charging rate for storage in each strategic period" + stor_charge_add: "Added charging rate" + stor_charge_rem: "Removed charging rate" + stor_discharge_capex: "Absolute CAPEX for investments in the discharging rate of a storage" + stor_discharge_invest_b: "Binary indicator of investments in discharging rate" + stor_discharge_remove_b: "Binary indicator of investments in discharging rate removal" + stor_discharge_current: "Installed rate for storage in each strategic period" + stor_discharge_add: "Added discharging rate" + stor_discharge_rem: "Removed rdischarging ate" + trans_cap_capex: "Absolute CAPEX for investments in the capacity of a transmission mode" + trans_cap_invest_b: "Binary indicator of investments in transmission capacity" + trans_cap_remove_b: "Binary indicator of investments in transmission capacity removal" + trans_cap_current: "Installed capacity for each strategic period" + trans_cap_add: "Added capacity" + trans_cap_rem: "Removed capacity" + + # EnergyModelsRenewableProducers + curtailment: "Curtailment of a non-dispatchable energy source" + hydro_spill: "Spilled water (not producing energy)" + gate_penalty_up: "Penalty variable for exceeding hydro gate constraints" + gate_penalty_down: "Penalty variable for not meeting hydro gate constraints" + rsv_penalty_up: "Penalty variable for exceeding hydro reservoir constraints" + rsv_penalty_down: "Penalty variable for not meeting hydro reservoir constraints" + gen_penalty_up: "Penalty variable for exceeding hydro unit generation constraints" + gen_penalty_down: "Penalty variable for not meeting hydro unit generation constraints" + discharge_segment: "Discharge segment variable for hydro unit discharge capacity" + bat_prev_use: "Accumulated charge effect of a battery up to an operational period" + bat_prev_use_sp: "Accumulated charge effect of a battery up to an investment period" + bat_use_sp: "Accumulated charge effect of a battery in an investment period" + bat_use_rp: "Accumulated charge effect of a battery in a representative period" + bat_stack_replace_b: "Binary variable for identifying battery stack replacement" + bat_res_up: "Upwards reserve of battery storage" + bat_res_down: "Downwards reserve of battery storage" + + # EnergyModelsHeat + dh_pipe_loss: "Heat losses in DH pipes" + + # EnergyModelsHydrogen + ref_off_b: "Binary variable indicating if the reformer is in the 'off' state" + ref_start_b: "Binary variable indicating if the reformer is in the 'start-up' state" + ref_on_b: "Binary variable indicating if the reformer is in the 'on' state" + ref_shut_b: "Binary variable indicating if the reformer is in the 'shutdown' state" + + elect_on_b: "Binary variable, 1 if electrolyzer is operating" + elect_prev_use: "Cumulative electrolyzer use since last stack replacement" + elect_prev_use_sp: "Cumulative electrolyzer use in investment periods since last stack replacement" + elect_use_sp: "Electrolyzer use in an investment period" + elect_use_rp: "Electrolyzer use in a representative period" + elect_stack_replace_b: "Binary variable for electrolyzer stack replacement" + elect_efficiency_penalty: "Efficiency penalty coefficient for electrolyzer" + + # EnergyModelsCO2 + stor_level_Δ_sp: "Increase in `stor_level` during a strategic period" # Overview of total quantities and their components total: opex_fields: - opex_var: "Total absolute variable OPEX" - opex_fixed: "Total absolute fixed OPEX" - trans_opex_var: "Total absolute variable transmission OPEX" - trans_opex_fixed: "Total absolute fixed transmission OPEX" + opex_var: "Total absolute variable OPEX" + opex_fixed: "Total absolute fixed OPEX" + trans_opex_var: "Total absolute variable transmission OPEX" + trans_opex_fixed: "Total absolute fixed transmission 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" - stor_charge_capex: "Total absolute CAPEX for investments in the charging rate of storages" - stor_discharge_capex: "Total absolute CAPEX for investments in the discharging rate of storages" - trans_cap_capex: "Total absolute CAPEX for investments in the capacity of transmission modes" + 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" + stor_charge_capex: "Total absolute CAPEX for investments in the charging rate of storages" + stor_discharge_capex: "Total absolute CAPEX for investments in the discharging rate of storages" + trans_cap_capex: "Total absolute CAPEX for investments in the capacity of transmission modes" # Names in the JuMP model that indicates if an investment has occured investment_indicators: diff --git a/src/setup_GUI.jl b/src/setup_GUI.jl index 1526e6d..3668b27 100644 --- a/src/setup_GUI.jl +++ b/src/setup_GUI.jl @@ -30,6 +30,7 @@ data stored as key-value pairs. This dictionary is corresponding to the the old main window. - **`fontsize::Int64=12`** is the general fontsize. - **`plot_widths::Tuple{Int64,Int64}=(1920, 1080)`** is the resolution of the window. +- **`case_name::String = ""`** provides a tag for the window title. - **`scale_tot_opex::Bool=false`** multiplies total OPEX quantities with the duration of the strategic period. - **`scale_tot_capex::Bool=false`** divides total CAPEX quantities with the duration of the strategic period. - **`colormap::Vector=Makie.wong_colors()`** is the colormap used for plotting results. @@ -292,7 +293,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) # Create GeoMakie plotable object countries = GeoMakie.to_multipoly(countries_geo_json.geometry) end - poly!( + countries_plot = poly!( ax, countries; color = :honeydew, @@ -301,6 +302,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) strokewidth = 0.5, inspectable = false, ) + Makie.translate!(countries_plot, 0, 0, -1) ocean_coords = [(180, -90), (-180, -90), (-180, 90), (180, 90)] ocean = poly!( ax, @@ -310,7 +312,7 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) strokecolor = :gray50, inspectable = false, ) - Makie.translate!(ocean, 0, 0, -1) + Makie.translate!(ocean, 0, 0, -2) else # The design does not use the EnergyModelsGeography package: Create a simple Makie axis ax = Axis( gridlayout_topology_ax[1, 1]; @@ -362,16 +364,26 @@ function create_makie_objects(vars::Dict, design::EnergySystemDesign) # Create legend to explain the available resources in the design model markers::Vector{Makie.Scatter} = Vector{Makie.Scatter}(undef, 0) - for color ∈ collect(values(design.id_to_color_map)) + + # Create an ordered list of colors (based on their id) + color_mat = + hcat(collect(keys(design.id_to_color_map)), collect(values(design.id_to_color_map))) + perm = sortperm(lowercase.(color_mat[:, 1])) + sorted_color_mat = color_mat[perm, :] + + # Create markers for colors in legend + for color ∈ sorted_color_mat[:, 2] push!( markers, scatter!(ax, Point2f((0, 0)); marker = :rect, color = color, visible = false), ) # add invisible dummy markers to be put in the legend box end + + # Add the legend to the axis topo_legend = axislegend( ax, markers, - collect(keys(design.id_to_color_map)), + sorted_color_mat[:, 1], "Resources"; position = :rt, labelsize = vars[:fontsize], diff --git a/src/setup_topology.jl b/src/setup_topology.jl index 12f9b6e..68a3c39 100644 --- a/src/setup_topology.jl +++ b/src/setup_topology.jl @@ -43,7 +43,7 @@ function EnergySystemDesign( # Complete the `id_to_color_map` if some products are lacking (this is done by choosing # colors for the lacking `Resource`s that are most distinct to the existing set of colors) - if !(length(get_products(system)) == length(id_to_color_map)) + if !issubset(get_products(system), keys(id_to_color_map)) id_to_color_map = set_colors(get_products(system), id_to_color_map) end @@ -87,7 +87,6 @@ function EnergySystemDesign( if element == get_ref_element(system) x = parent_x y = parent_y - nodes_count -= 1 else # place nodes in a circle around the parents availability node x, y = place_nodes_in_circle( nodes_count, current_node, 1, parent_x, parent_y, diff --git a/src/utils_gen/structures_utils.jl b/src/utils_gen/structures_utils.jl index 8906ce7..5d91093 100644 --- a/src/utils_gen/structures_utils.jl +++ b/src/utils_gen/structures_utils.jl @@ -166,9 +166,6 @@ function design_file(system::AbstractSystem, path::String) if isempty(path) return "" end - if !isdir(path) - mkpath(path) - end return joinpath(path, "$(get_parent(system)).yml") end @@ -233,6 +230,10 @@ Save the x,y-coordinates of `design_dict` to a .yml file at location and filenam `file`. """ function save_design(design_dict::Dict, file::String) + design_dir = dirname(file) + if !isdir(design_dir) + mkpath(design_dir) + end return YAML.write_file(file, design_dict) end @@ -242,7 +243,7 @@ end links::Vector{Link}, area_links::Vector{Link}, area_nodes::Vector{EMB.Node}, - indices::Vector{Int + indices::Vector{Int}, ) Recursively find all nodes connected (directly or indirectly) to `node` in a system of `links`