Skip to content

Commit 090909c

Browse files
author
Jon Vegard Venås
authored
Improve descriptive_names (#44)
Enable proper testing of descriptive_names and fix docs and improve documentation
1 parent a0ba5e9 commit 090909c

14 files changed

Lines changed: 1002 additions & 21 deletions

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release notes
22

3+
## Version 0.6.1 (2025-12-17)
4+
5+
### Enhancements
6+
7+
* Improved testing of `descriptive_names` and added more names from other packages.
8+
* Improved documentation.
9+
10+
311
## Version 0.6.0 (2025-12-15)
412

513
### Bugfix

docs/make.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ makedocs(;
5050
"Customize colors"=>"how-to/customize-colors.md",
5151
"Customize icons"=>"how-to/customize-icons.md",
5252
"Customize descriptive_names"=>"how-to/customize-descriptive_names.md",
53+
"Improve performance"=>"how-to/improve-performance.md",
54+
"Use custom backgroun map"=>"how-to/use-custom-background-map.md",
5355
],
5456
"Library" => Any[
5557
"Public"=>"library/public.md",
159 KB
Loading

docs/src/how-to/customize-descriptive_names.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
`EnergyModelsGUI` provides a set of descriptive names for case input structures and assosiated JuMP variables.
44
These can be found in `src/descriptive_names.yml`. These descriptions are extended/overwritten with EMX
5-
packages having a `descriptive_names.yml` file in a `ext/EMGUIExt` folder of its repository. That is,
6-
if you want to provide descriptive names for your EMX package, add a `.yml` file in this location, with the
7-
same structure as `src/descriptive_names.yml`.
5+
packages having a `descriptive_names.yml` file in a `ext/EMGUIExt` folder of its repository (having a module
6+
name starting with `EnergyModel`). That is, if you want to provide descriptive names for your EMX package,
7+
add a `.yml` file in this location, with the same structure as `src/descriptive_names.yml`.
88

99
It can be convenient to provide a user defined file in addition.
1010
If you have this file located at `path_to_descriptive_names`, simply add it using
@@ -18,13 +18,15 @@ If you instead (or in addition) want to provide descriptive names through a `Dic
1818
```julia
1919
descriptive_names_dict = Dict(
2020
:structures => Dict( # Input parameter from the case Dict
21-
:RefStatic => Dict(
22-
:trans_cap => "New description for `trans_cap`",
23-
:opex_fixed => "New description for `opex_fixed`",
24-
),
25-
:RefDynamic => Dict(
26-
:opex_var => "New description for `opex_var`",
27-
:directions => "New description for `directions`",
21+
:EnergyModelsGeography => Dict( # Input parameter from the case Dict
22+
:RefStatic => Dict(
23+
:trans_cap => "New description for `trans_cap`",
24+
:opex_fixed => "New description for `opex_fixed`",
25+
),
26+
:RefDynamic => Dict(
27+
:opex_var => "New description for `opex_var`",
28+
:directions => "New description for `directions`",
29+
),
2830
),
2931
),
3032
:variables => Dict( # variables from the JuMP model
@@ -34,7 +36,6 @@ descriptive_names_dict = Dict(
3436
)
3537
gui = GUI(
3638
case;
37-
path_to_descriptive_names=path_to_descriptive_names,
3839
descriptive_names_dict=descriptive_names_dict,
3940
)
4041
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# [Improve performance](@id how_to-improve_performance)
2+
3+
Due to the just-in-time (JIT) compilation of Julia, the instantiation of the `EnergyModelsGUI` window takes some time (but reopening the window will take less time).
4+
This also includes interactive features in the GUI (creating the first plot is a lot slower than creating subsequent plots).
5+
6+
That being said, it is possible to boost startup time by turning of redundant features.
7+
One can for example plot sub-areas only on demand (which for large system significantly reduces setup of the `GUI`) through
8+
9+
```julia
10+
gui = GUI(case; pre_plot_sub_components = false)
11+
```
12+
13+
If there is no need to use the background map when using `EnergyModelsGeography` one can skip the usage of `GeoMakie` (this will also increase performance)
14+
15+
```julia
16+
gui = GUI(case; use_geomakie = false)
17+
```
18+
19+
If the user do not see any usage of the `DataInspector` tool provided by `Makie` (which enables information of plot objects upon hovering with the mouse) one could use the `enable_data_inspector` toogle to further improve performance
20+
21+
```julia
22+
gui = GUI(case; enable_data_inspector = false)
23+
```
24+
25+
It is also possible to use a simplified plotting of the `Link`s/`Transmission`s using the `simplified_connection_plotting` which improves performance slightly.
26+
This option is however more motivated by simplified visuals.
27+
One can also use `simplify_all_levels` to have this simplified plotting on all levels (not just the top level).
28+
29+
```julia
30+
gui = GUI(case; simplified_connection_plotting = true, simplify_all_levels = true)
31+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# [Use custom backgruond map](@id how_to-use_custom_backgruond_map)
2+
3+
The GUI enables user defined background maps in `.geojson` format through the `GUI` constructor parameter `String::map_boundary_file`. One could for example download NUTS boundaries as GeoJSON from [datahub.io](https://datahub.io/core/geo-nuts-administrative-boundaries), save this file at a desired location and use this file path as `map_boundary_file`.
4+
5+
Downloading [NUTS2](https://r2.datahub.io/clt98mkvt000ql70811z8xj6l/main/raw/data/NUTS_RG_60M_2024_4326_LEVL_2.geojson), one can with a EMX-case variable `case`
6+
7+
```julia
8+
gui = GUI(case; map_boundary_file = joinpath(@__DIR__, "NUTS_RG_60M_2024_4326_LEVL_2.geojson"))
9+
```
10+
11+
get something like
12+
13+
![NUTS2 illustration](../figures/NUTS2_illustration.png)

src/descriptive_names.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,30 @@ structures:
9393
AbstractBatteryLife:
9494
stack_cost: "Relative cost for replacing a battery stack"
9595

96+
EnergyModelsHeat:
97+
## link.jl
98+
DHPipe:
99+
cap: "Heat transport capacity of the pipe"
100+
t_ground: "Ground temperature in °C"
101+
102+
## node.jl
103+
HeatPump:
104+
t_source: "Heat source temperature"
105+
t_sink: "Heat sink temperature"
106+
eff_carnot: "Carnot Efficiency"
107+
108+
## resource.jl
109+
ResourceHeat:
110+
t_supply: "Supply temperature in °C"
111+
t_return: "Return temperature in °C"
112+
113+
PinchData:
114+
T_SH_hot: "Hot temperature of surplus heat source in °C"
115+
T_SH_cold: "Cold temperature of surplus heat source in °C"
116+
ΔT_min: "Minimum temperature difference between surplus source and DH network in °C"
117+
T_DH_hot: "Hot temperature of district heating network in °C"
118+
T_DH_cold: "Cold temperature of district heating network in °C"
119+
96120
EnergyModelsHydrogen:
97121
## node.jl
98122
AbstractElectrolyzer:
@@ -227,6 +251,23 @@ variables:
227251
# EnergyModelsCO2
228252
stor_level_Δ_sp: "Increase in `stor_level` during a strategic period"
229253

254+
# EnergyModelsHeat
255+
dh_pipe_loss: "Heat losses in DH pipes"
256+
257+
# EnergyModelsLanguageInterface
258+
buildings_surplus: "Surplus delivered to a sink, i.e., oversatisfied demand"
259+
buildings_deficit: "Deficit in a sink, i.e., not satisfied demand"
260+
solar_curtailment: "Curtailment of a solar energy source"
261+
solar_cap_use: "Absolute capacity utilization"
262+
263+
# EnergyModelsFlex
264+
input_frac_strat: "Input resource fraction"
265+
load_shift_from: "Load shift from"
266+
load_shift_to: "Load shift to"
267+
load_shifted: "Load shifted"
268+
sink_surplus_p: "Penalties for surplus of resource"
269+
sink_deficit_p: "Penalties for deficits of resource"
270+
230271
# Overview of total quantities and their components
231272
total:
232273
opex_fields:

test/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[deps]
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50"
4+
EnergyModelsCO2 = "84b3f4d7-d799-4a5d-b06c-25c90dcfcad7"
45
EnergyModelsGeography = "3f775d88-a4da-46c4-a2cc-aa9f16db6708"
6+
EnergyModelsHeat = "ad1b8b27-e232-4da9-b498-bea9c19a30d7"
7+
EnergyModelsHydrogen = "44855f8b-b147-4985-ac18-48817d03c548"
58
EnergyModelsInvestments = "fca3f8eb-b383-437d-8e7b-aac76bb2004f"
69
EnergyModelsRenewableProducers = "b007c34f-ba52-4995-ba37-fffe79fbde35"
710
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
@@ -10,6 +13,7 @@ JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1013
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1114
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1215
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
16+
SCIP = "82193955-e24f-5292-bf16-6f2c5261a85f"
1317
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1418
TimeStruct = "f9ed5ce0-9f41-4eaa-96da-f38ab8df101c"
1519
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
n_Reg_1-CO2_storage_geo:
2+
y: 46.26174
3+
x: 5.0772
4+
n_Reg_1-Coal_source:
5+
y: 46.26174
6+
x: 6.92496
7+
n_Reg_1-Coal_power_plant:
8+
y: 45.17195
9+
x: 5.29398
10+
n_Reg_1-Electricity_demand:
11+
y: 46.87906
12+
x: 6.00108
13+
n_Reg_1-Availability:
14+
y: 45.87906
15+
x: 6.00108
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
n_CO2_storage_big:
2+
y: 45.76981
3+
x: 8.47282
4+
n_Reg_2-NG_source:
5+
y: 44.80648
6+
x: 8.57883
7+
n_heat_demand:
8+
y: 46.08825
9+
x: 10.21651
10+
"n_hydrogen storage":
11+
y: 45.4147
12+
x: 8.44048
13+
n_CO2_storage_small:
14+
y: 46.27751
15+
x: 9.99404
16+
n_ss_inv_electricity_demand:
17+
y: 46.1934
18+
x: 10.11129
19+
"n_reserve down demand":
20+
y: 46.42308
21+
x: 10.07954
22+
n_market_buy:
23+
y: 45.46697
24+
x: 9.71667
25+
n_hydro_pump:
26+
y: 44.64628
27+
x: 10.23688
28+
n_balancing_source:
29+
y: 46.04724
30+
x: 8.55851
31+
n_hydro_generator_down:
32+
y: 44.32898
33+
x: 10.13109
34+
n_water_source:
35+
y: 45.57435
36+
x: 10.76056
37+
n_hydro_av:
38+
y: 45.53768
39+
x: 9.8735
40+
n_heat_pump:
41+
y: 46.3376
42+
x: 9.41381
43+
n_hydro_generator_up:
44+
y: 45.1698
45+
x: 10.21044
46+
n_wind_simple:
47+
y: 46.2075
48+
x: 8.45478
49+
n_ss_electricity_demand:
50+
y: 45.7621
51+
x: 10.07954
52+
n_hub-h2_demand:
53+
y: 45.86594
54+
x: 10.2105
55+
n_battery:
56+
y: 46.42614
57+
x: 9.93808
58+
n_CCGT_retrofittable:
59+
y: 45.60759
60+
x: 8.69229
61+
n_PEM:
62+
y: 45.21135
63+
x: 8.43592
64+
n_ocean:
65+
y: 43.95617
66+
x: 10.14167
67+
n_TES:
68+
y: 46.49982
69+
x: 9.57916
70+
n_market_sale:
71+
y: 45.4147
72+
x: 10.22099
73+
n_ss_electricity_source:
74+
y: 45.94354
75+
x: 8.45164
76+
n_hub-electricity_source:
77+
y: 45.00822
78+
x: 8.48167
79+
n_district_heat_source:
80+
y: 46.50915
81+
x: 9.30152
82+
n_NG_source_for_CCGT:
83+
y: 45.59557
84+
x: 8.45479
85+
n_hub:
86+
y: 45.57898
87+
x: 9.28942
88+
n_ss_inv_electricity_source:
89+
y: 46.33006
90+
x: 8.52708
91+
n_h2_demand_reformer:
92+
y: 45.65866
93+
x: 10.20449
94+
n_Reg_2-Availability:
95+
y: 45.3385
96+
x: 9.42555
97+
n_CCS_unit:
98+
y: 45.73977
99+
x: 8.69229
100+
n_CO2_source_negative:
101+
y: 46.44946
102+
x: 8.67481
103+
n_hydro_reservoir_up:
104+
y: 45.17244
105+
x: 10.54897
106+
n_reformer:
107+
y: 46.58908
108+
x: 9.83352
109+
n_Reg_2-ng+CCS_power_plant:
110+
y: 44.70925
111+
x: 9.43732
112+
n_electricity_demand_big:
113+
y: 45.94706
114+
x: 10.09024
115+
n_hydropower_simple:
116+
y: 46.5186
117+
x: 8.94828
118+
n_hydro_gate:
119+
y: 44.90462
120+
x: 10.5442
121+
n_Reg_2-Electricity_demand:
122+
y: 44.89218
123+
x: 9.73437
124+
n_CO2_storage_reformer_sink:
125+
y: 46.58908
126+
x: 10.08261
127+
n_hydro_reservoir_down:
128+
y: 44.61719
129+
x: 10.50137

0 commit comments

Comments
 (0)