Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that errored on time-indepentent variables #14

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release notes

## Version 0.5.7 (2024-10-09)

### Bugfix

* Fix bug that errored on time-indepentent variables by ignoring these.

## Version 0.5.6 (2024-09-16)

### Bugfix
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EnergyModelsGUI"
uuid = "737a7361-d3b7-40e9-b1ac-59bee4c5ea2d"
authors = ["Jon Vegard Venås <JonVegard.Venas@sintef.no>", "Magnus Askeland <Magnus.Askeland@sintef.no>", "Shweta Tiwari <Shweta.Tiwari@sintef.no>"]
version = "0.5.6"
version = "0.5.7"

[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Expand Down
2 changes: 0 additions & 2 deletions examples/EMI_geography.jl
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@ solution_summary(m)
# Uncomment to print all the constraints set in the model.
# print(m)

solution_summary(m)

############################################################################################
## Code below for displaying the GUI

Expand Down
9 changes: 5 additions & 4 deletions src/setup_GUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Initialize the EnergyModelsGUI window and visualize the topology of a system `ca
# Keyword arguments:

- **`design_path::String=""`** is a file path or identifier related to the design.
- **`id_to_color_map::Dict=Dict()` is a dict that maps `Resource`s `id` to colors.
- **`id_to_icon_map::Dict=Dict()` is a dict that maps `Node/Area` `id` to .png files for icons.
- **`id_to_color_map::Dict=Dict()`** is a dict that maps `Resource`s `id` to colors.
- **`id_to_icon_map::Dict=Dict()`** is a dict that maps `Node/Area` `id` to .png files for icons.
- **`model::JuMP.Model=JuMP.Model()`** is the solved JuMP model with results for the `case`.
- **`hide_topo_ax_decorations::Bool=true`** is a visibility toggle of ticks, ticklabels and
grids for the topology axis.
Expand All @@ -24,8 +24,9 @@ Initialize the EnergyModelsGUI window and visualize the topology of a system `ca
representative periods.
- **`scenarios_labels::Vector=[]`** are descriptive labels for scenarios.
- **`path_to_results::String=""`** is the path to where exported files are stored.
- **`path_to_descriptive_names::String=""` is the Path to a .yml file where variables.
are described.
- **`path_to_descriptive_names::String=""`** is the Path to a .yml file where variables
are described.
- **`descriptive_names_dict::Dict=Dict()`** is a dictionary where variables are described.
- **`coarse_coast_lines::Bool=true`** is a toggle for coarse or fine resolution coastlines.
- **`backgroundcolor=GLMakie.RGBf(0.99, 0.99, 0.99)`** is the background color of the
main window.
Expand Down
5 changes: 4 additions & 1 deletion src/utils_GUI/GUI_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ function initialize_available_data!(gui)
if isempty(var)
continue
end
i_T, type = get_time_axis(model[sym])
i_T, type = get_time_axis(var)
if isnothing(type) # No time dimension found
continue
end
periods = get_periods(T, type)

for combination ∈ get_combinations(var, i_T)
Expand Down
4 changes: 3 additions & 1 deletion src/utils_GUI/results_axis_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function create_description(gui::GUI, key_str::String; pre_desc::String="")
catch
description = key_str[(findfirst('.', key_str) + 1):end]
@warn "Could't find a description for $description. \
Using the string $description instead"
Using the string $description instead. \
You can customize the descriptions as explained here: \
https://energymodelsx.github.io/EnergyModelsGUI.jl/stable/how-to/customize-descriptive_names/"
end
return description
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_interactivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import EnergyModelsGUI:

case, model, m, gui = run_case()

op_cost = [3371970.004, 5382390.006, 2010420.002]
inv_cost = [0.0, 0.0, 29536224.88]
op_cost = [3371970.00359, 5382390.00598, 2010420.00219]
inv_cost = [0.0, 0.0, 29536224.881975]
@testset "Compare with Integrate results" begin
T = get_design(gui).system[:T]
for (i, t) ∈ enumerate(strategic_periods(T))
Expand Down
Loading