Internals
Index
EnergyModelsGUI.AbstractGUIObj
EnergyModelsGUI.AbstractSystem
EnergyModelsGUI.Connection
EnergyModelsGUI.EnergySystemIterator
EnergyModelsGUI.NothingElement
EnergyModelsGUI.ProcInvData
EnergyModelsGUI.System
EnergyModelsGUI.SystemGeo
Base.iterate
EnergyModelsBase.get_elements_vec
EnergyModelsBase.get_nodes
EnergyModelsGUI.add_component!
EnergyModelsGUI.add_description!
EnergyModelsGUI.add_description!
EnergyModelsGUI.add_description!
EnergyModelsGUI.add_description!
EnergyModelsGUI.add_inspector_to_poly!
EnergyModelsGUI.adjust_limits!
EnergyModelsGUI.align
EnergyModelsGUI.angle
EnergyModelsGUI.angle_difference
EnergyModelsGUI.box
EnergyModelsGUI.clear_selection
EnergyModelsGUI.connect!
EnergyModelsGUI.connect!
EnergyModelsGUI.create_description
EnergyModelsGUI.create_label
EnergyModelsGUI.create_makie_objects
EnergyModelsGUI.define_event_functions
EnergyModelsGUI.design_file
EnergyModelsGUI.draw_box!
EnergyModelsGUI.draw_icon!
EnergyModelsGUI.draw_label!
EnergyModelsGUI.export_svg
EnergyModelsGUI.export_to_file
EnergyModelsGUI.export_xlsx
EnergyModelsGUI.export_xlsx
EnergyModelsGUI.extract_data_selection
EnergyModelsGUI.extract_svg
EnergyModelsGUI.find_icon
EnergyModelsGUI.find_min_max_coordinates
EnergyModelsGUI.find_min_max_coordinates
EnergyModelsGUI.find_type_field
EnergyModelsGUI.format_number
EnergyModelsGUI.get_EMGUI_obj
EnergyModelsGUI.get_JuMP_names
EnergyModelsGUI.get_available_data
EnergyModelsGUI.get_ax
EnergyModelsGUI.get_axes
EnergyModelsGUI.get_button
EnergyModelsGUI.get_capex
EnergyModelsGUI.get_change
EnergyModelsGUI.get_children
EnergyModelsGUI.get_color
EnergyModelsGUI.get_colors
EnergyModelsGUI.get_combinations
EnergyModelsGUI.get_components
EnergyModelsGUI.get_connections
EnergyModelsGUI.get_connections
EnergyModelsGUI.get_data
EnergyModelsGUI.get_default_colors
EnergyModelsGUI.get_design
EnergyModelsGUI.get_element
EnergyModelsGUI.get_element
EnergyModelsGUI.get_element
EnergyModelsGUI.get_element_label
EnergyModelsGUI.get_fig
EnergyModelsGUI.get_file
EnergyModelsGUI.get_from
EnergyModelsGUI.get_hover_string
EnergyModelsGUI.get_icon
EnergyModelsGUI.get_inv_data
EnergyModelsGUI.get_inv_data
EnergyModelsGUI.get_inv_times
EnergyModelsGUI.get_investment_times
EnergyModelsGUI.get_jump_axis_types
EnergyModelsGUI.get_legend
EnergyModelsGUI.get_linestyle
EnergyModelsGUI.get_linestyle
EnergyModelsGUI.get_linestyle
EnergyModelsGUI.get_linked_nodes!
EnergyModelsGUI.get_links
EnergyModelsGUI.get_max_installed
EnergyModelsGUI.get_menu
EnergyModelsGUI.get_menus
EnergyModelsGUI.get_mode_to_transmission_map
EnergyModelsGUI.get_model
EnergyModelsGUI.get_nested_value
EnergyModelsGUI.get_nth_field
EnergyModelsGUI.get_op
EnergyModelsGUI.get_parent
EnergyModelsGUI.get_parent
EnergyModelsGUI.get_parent
EnergyModelsGUI.get_periods
EnergyModelsGUI.get_plots
EnergyModelsGUI.get_plots
EnergyModelsGUI.get_plotted_data
EnergyModelsGUI.get_products
EnergyModelsGUI.get_ref_element
EnergyModelsGUI.get_ref_element
EnergyModelsGUI.get_representative_period_indices
EnergyModelsGUI.get_resource_colors
EnergyModelsGUI.get_resource_colors
EnergyModelsGUI.get_resource_colors
EnergyModelsGUI.get_results_legend
EnergyModelsGUI.get_root_design
EnergyModelsGUI.get_scenario_indices
EnergyModelsGUI.get_sector_points
EnergyModelsGUI.get_selected_plots
EnergyModelsGUI.get_selected_systems
EnergyModelsGUI.get_selection_color
EnergyModelsGUI.get_supertypes
EnergyModelsGUI.get_system
EnergyModelsGUI.get_text_alignment
EnergyModelsGUI.get_time_axis
EnergyModelsGUI.get_time_struct
EnergyModelsGUI.get_time_struct
EnergyModelsGUI.get_time_struct
EnergyModelsGUI.get_to
EnergyModelsGUI.get_toggle
EnergyModelsGUI.get_topo_legend
EnergyModelsGUI.get_transmissions
EnergyModelsGUI.get_var
EnergyModelsGUI.get_vars
EnergyModelsGUI.get_vis_plots
EnergyModelsGUI.get_visible_data
EnergyModelsGUI.get_wall
EnergyModelsGUI.get_xy
EnergyModelsGUI.getfirst
EnergyModelsGUI.has_invested
EnergyModelsGUI.includes_area
EnergyModelsGUI.initialize_available_data!
EnergyModelsGUI.initialize_plot!
EnergyModelsGUI.installed
EnergyModelsGUI.l2_norm
EnergyModelsGUI.merge_dicts
EnergyModelsGUI.merge_svg_strings
EnergyModelsGUI.mouse_within_axis
EnergyModelsGUI.nested_eltype
EnergyModelsGUI.new_global_delta_h
EnergyModelsGUI.parse_case
EnergyModelsGUI.pick_component!
EnergyModelsGUI.pixel_to_data
EnergyModelsGUI.place_nodes_in_circle
EnergyModelsGUI.plot_design!
EnergyModelsGUI.print_nested_structure!
EnergyModelsGUI.save_design
EnergyModelsGUI.save_design
EnergyModelsGUI.scroll_ylim
EnergyModelsGUI.select_data!
EnergyModelsGUI.square_intersection
EnergyModelsGUI.square_intersection
EnergyModelsGUI.sub_system
EnergyModelsGUI.toggle_inspector!
EnergyModelsGUI.toggle_selection_color!
EnergyModelsGUI.update!
EnergyModelsGUI.update!
EnergyModelsGUI.update!
EnergyModelsGUI.update!
EnergyModelsGUI.update_available_data_menu!
EnergyModelsGUI.update_axis!
EnergyModelsGUI.update_barplot_dodge!
EnergyModelsGUI.update_descriptive_names!
EnergyModelsGUI.update_distances!
EnergyModelsGUI.update_info_box!
EnergyModelsGUI.update_legend!
EnergyModelsGUI.update_limits!
EnergyModelsGUI.update_limits!
EnergyModelsGUI.update_plot!
EnergyModelsGUI.update_plot!
EnergyModelsGUI.update_plot!
EnergyModelsGUI.update_plot!
EnergyModelsGUI.update_sub_system_locations!
EnergyModelsGUI.update_title!
Types
EnergyModelsGUI.AbstractGUIObj
— TypeAbstractGUIObj
Supertype for EnergyModelsGUI objects representing Node
s/Link
s/Area
s/Transmission
s.
EnergyModelsGUI.AbstractSystem
— TypeAbstractSystem
Supertype for EnergyModelsGUI objects representing a sub system of a Case.
EnergyModelsGUI.Connection
— TypeConnection <: AbstractGUIObj
Mutable type for providing a flexible data structure for connections between EnergySystemDesign
s.
Fields
from::EnergySystemDesign
is theEnergySystemDesign
from which the connection originates.to::EnergySystemDesign
is theEnergySystemDesign
to which the connection is linked to.connection::AbstractElement
is the EMX connection structure.colors::Vector{RGB}
is the associated colors of the connection.plots::Vector{Any}
is a vector with all Makie object associated with this object.invest_data::ProcInvData
stores processed investment data.
EnergyModelsGUI.EnergySystemIterator
— TypeEnergySystemIterator
Type for iterating over nested EnergySystemDesign
structures, enabling recursion through AbstractGUIObj
s.
Fields
stack::Vector{<:AbstractGUIObj}
is the stack used to manage the iteration through the nestedEnergySystemDesign
components (and its connections). It starts with the initialEnergySystemDesign
object and progressively includes its subcomponents as the iteration proceeds.
EnergyModelsGUI.NothingElement
— TypeNothingElement <: AbstractElement
Type for representing an empty Element (the "nothing" element).
EnergyModelsGUI.ProcInvData
— TypeProcInvData
Type for storing processed investment data.
Fields
inv_times::Vector{String}
is a vector of formatted strings for added investments.capex::Vector{Number}
contains the capex of all times with added investments.invested::Bool
indicates if the element has been invested in.
EnergyModelsGUI.System
— TypeSystem
Type for storing processed system data from EnergyModelsBase.
Fields
T::TimeStructure
is the time structure of the model.products::Vector{<:Resource}
are the resources that should be incorporated into the model.elements::Vector{Vector}
are the vectors ofAbstractElement
that should be included in the analysis.children::Vector{<:EMB.Node}
are the children of the system.connections::Vector{<:Link}
are the connections between system parts.parent::AbstractElement
is the parent of the system (e.g., theArea
node of the referenceGeoAvailability
node).ref_element::AbstractElement
is the reference element of the system (firstAvailability
node).
EnergyModelsGUI.SystemGeo
— TypeSystemGeo
Type for storing processed system data from EnergyModelsGeography.
Fields
T::TimeStructure
is the time structure of the model.products::Vector{<:Resource}
are the resources that should be incorporated into the model.elements::Vector{Vector}
are the vectors ofAbstractElement
that should be included in the analysis.children::Vector{<:EMB.Node}
are the children of the system.connections::Vector{<:Link}
are the connections between system parts.parent::AbstractElement
is the parent of the system.ref_element::AbstractElement
is the reference element of the system.
Methods
Base.iterate
— Functioniterate(itr::EnergySystemIterator)
Initialize the iteration over an EnergySystemIterator
, returning the first EnergySystemDesign
object in the stack and the iterator itself. If the stack is empty, return nothing
.
EnergyModelsBase.get_elements_vec
— Methodget_elements_vec(system::AbstractSystem)
Returns the vector of element-vectors of the AbstractSystem system
.
EnergyModelsBase.get_nodes
— Methodget_nodes(system::AbstractSystem)
Returns the ref_element
field of a AbstractSystem
system
.
EnergyModelsGUI.add_component!
— Methodadd_component!(gui::GUI, component::EnergySystemDesign)
Draw a box containing the icon and add a label with the id of the EnergySystemDesign component
with its type in parantheses.
EnergyModelsGUI.add_description!
— Methodadd_description!(
field::Any,
name::String,
::String,
pre_desc::String,
element,
available_data::Vector{Dict},
gui::GUI,
)
Loop through all struct fieldnames of field
(i.e. for the field level
of type NoStartInvData
) and update available_data
with an added description.
EnergyModelsGUI.add_description!
— Methodadd_description!(
field::Dict,
name::String,
key_str::String,
pre_desc::String,
element,
available_data::Vector{Dict},
gui::GUI,
)
Loop through all dictnames
for a field
of type Dict
(e.g. for the field penalty
having the keys :deficit and surplus) and update available_data
with an added description.
EnergyModelsGUI.add_description!
— Methodadd_description!(
field::TS.TimeProfile,
name::String,
key_str::String,
pre_desc::String,
element,
available_data::Vector{Dict},
gui::GUI,
)
Create a container with a description, and add container
to available_data
.
EnergyModelsGUI.add_description!
— Methodadd_description!(
field::Vector,
name::String,
key_str::String,
pre_desc::String,
element,
available_data::Vector{Dict},
gui::GUI,
)
Loop through all elements of field
of type Vector
(i.e. for the field data
) and update available_data
with an added description.
EnergyModelsGUI.add_inspector_to_poly!
— Methodadd_inspector_to_poly!(p::Makie.AbstractPlot, inspector_label::Function)
Add inspector_label
for Poly and Mesh plots in plot p
.
EnergyModelsGUI.adjust_limits!
— Methodadjust_limits!(gui::GUI)
Adjust the limits of get_axes(gui)[:topo] based on its content.
EnergyModelsGUI.align
— Methodalign(gui::GUI, align::Symbol)
Align components in get_selected_systems(gui)
based on the value of Symbol align
.
The following values are allowed
:horizontal
for horizontal alignment.:vertical
for vertical alignment.
EnergyModelsGUI.angle
— Methodangle(node_1::EnergySystemDesign, node_2::EnergySystemDesign)
Based on the location of node_1
and node_2
, return the angle between the x-axis and node_2
with node_1
being the origin.
EnergyModelsGUI.angle_difference
— Methodangle_difference(angle1, angle2)
Compute the difference between two angles.
EnergyModelsGUI.box
— Methodfunction box(x, y, Δ)
Get the coordinates of a box with half side lengths Δ
and centered at (x
,y
) starting at the upper right corner.
EnergyModelsGUI.clear_selection
— Methodclear_selection(gui::GUI; clear_topo=true, clear_results=true)
Clear the color selection of components within 'getdesign(gui)' instance and reset the `getselected_systems(gui)` variable.
EnergyModelsGUI.connect!
— Methodconnect!(gui::GUI, connection::Connection, two_way::Bool)
When a boolean argument two_way
is specified, draw the lines in both directions.
EnergyModelsGUI.connect!
— Methodconnect!(gui::GUI, design::EnergySystemDesign)
Draws lines between connected nodes/areas in GUI gui
using EnergySystemDesign design
.
EnergyModelsGUI.create_description
— Methodcreate_description(
gui::GUI,
key_str::String;
pre_desc::String="",
)
Create description from get_var(gui,:descriptive_names)
if available
EnergyModelsGUI.create_label
— Methodcreate_label(selection::Vector{Any})
Return a label for a given selection
to be used in the getmenus(gui)[:availabledata] menu.
EnergyModelsGUI.create_makie_objects
— Methodcreate_makie_objects(vars::Dict, design::EnergySystemDesign)
Create Makie figure and all its objects (buttons, menus, toggles and axes) for EnergySystemDesign design
and the options vars
.
EnergyModelsGUI.define_event_functions
— Methoddefine_event_functions(gui::GUI)
Define event functions (handling button clicks, plot updates, etc.) for the GUI gui
.
EnergyModelsGUI.design_file
— Methoddesign_file(system::AbstractSystem, path::String)
Construct the path for the .yml file for system
in the folder path
.
EnergyModelsGUI.draw_box!
— Methoddraw_box!(gui::GUI, design::EnergySystemDesign)
Draw a box for EnergySystemDesign design
and it's appearance, including style, color, size.
EnergyModelsGUI.draw_icon!
— Methoddraw_icon!(gui::GUI, design::EnergySystemDesign)
Draw an icon for EnergySystemDesign design
.
EnergyModelsGUI.draw_label!
— Methoddraw_label!(gui::GUI, component::EnergySystemDesign)
Add a label to an EnergySystemDesign
component.
EnergyModelsGUI.export_svg
— Methodexport_svg(ax::Makie.Block, filename::String)
Export the ax
to a .svg file with path given by filename
.
EnergyModelsGUI.export_to_file
— Methodexport_to_file(gui::GUI)
Export results based on the state of gui
.
EnergyModelsGUI.export_xlsx
— Methodexport_xlsx(gui::GUI, filename::String)
Export the JuMP fields to an xlsx file with path given by filename
.
EnergyModelsGUI.export_xlsx
— Methodexport_xlsx(plots::Vector, filename::String, xlabel::Symbol)
Export the plots
to a .xlsx file with path given by filename
and top header xlabel
.
EnergyModelsGUI.extract_data_selection
— Methodextract_data_selection(var::SparseVars, selection::Vector, i_T::Int64, periods::Vector)
Extract data from var
having its time dimension at index i_T
for all time periods in periods
.
EnergyModelsGUI.extract_svg
— Methodextract_svg(svg_string)
Extracts the raw SVG content from the representation.
EnergyModelsGUI.find_icon
— Methodfind_icon(system::AbstractSystem, id_to_icon_map::Dict)
Find the icon associated with a given system
's node id utilizing the mapping provided through id_to_icon_map
.
EnergyModelsGUI.find_min_max_coordinates
— Methodfind_min_max_coordinates(
design::EnergySystemDesign,
min_x::Number,
max_x::Number,
min_y::Number,
max_y::Number
)
Find the minimum and maximum coordinates of the components of EnergySystemDesign
design given the minimum and maximum coordinates min_x
, min_y
, max_x
, and max_y
.
EnergyModelsGUI.find_min_max_coordinates
— Methodfind_min_max_coordinates(design::EnergySystemDesign)
Find the minimum and maximum coordinates of the components of EnergySystemDesign design
.
EnergyModelsGUI.find_type_field
— Methodfind_type_field(dict::Dict, x::Any)
Return closest supertype of a key being of same type as x
.
EnergyModelsGUI.format_number
— Methodformat_number(x::Number)
Format number x
to two decimals and add thousands seperators (comma).
EnergyModelsGUI.get_EMGUI_obj
— Methodget_EMGUI_obj(plt)
Get the EnergySystemDesign
/Connection
assosiated with plt
. Note that due to the nested structure of Makie, we must iteratively look through up to three nested layers to find where this object is stored.
EnergyModelsGUI.get_JuMP_names
— Methodget_JuMP_names(gui::GUI)
Get all names registered in the model as a vector except the names to be ignored.
EnergyModelsGUI.get_available_data
— Methodget_available_data(gui::GUI)
Get the vector of containers for the available data from the gui
.
EnergyModelsGUI.get_ax
— Methodget_ax(gui::GUI, ax_name::Symbol)
Returns the ax
object with name ax_name
of a GUI
gui
.
EnergyModelsGUI.get_axes
— Methodget_axes(gui::GUI)
Returns the axes
field of a GUI
gui
.
EnergyModelsGUI.get_button
— Methodget_button(gui::GUI, button_name::Symbol)
Returns the button
with name button_name
of a GUI
gui
.
EnergyModelsGUI.get_capex
— Methodget_capex(data::ProcInvData)
get_capex(design::AbstractGUIObj)
Returns the capex
of the investments of a ProcInvData
/AbstractGUIObj
object data
.
EnergyModelsGUI.get_change
— Methodget_change(::GUI, ::Val)
Handle different keyboard inputs (events) and return changes in x, y coordinates in the design object gui
.
EnergyModelsGUI.get_children
— Methodget_children(system::AbstractSystem)
Returns the parent
field of a AbstractSystem
system
.
EnergyModelsGUI.get_color
— Methodget_color(design::EnergySystemDesign)
Returns the color
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_colors
— Methodget_colors(conn::Connection)
Returns the colors
field of a Connection
conn
.
EnergyModelsGUI.get_combinations
— Methodget_combinations(var, i_T::Int)
Get an iterator of combinations of unique indices excluding the time index located at index i_T
.
EnergyModelsGUI.get_components
— Methodget_components(design::EnergySystemDesign)
Returns the components
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_connections
— Methodget_connections(system::AbstractSystem)
Returns the connections
field of a AbstractSystem
system
.
EnergyModelsGUI.get_connections
— Methodget_connections(design::EnergySystemDesign)
Returns the connections
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_data
— Methodget_data(
model::JuMP.Model,
selection::Dict{Symbol, Any},
T::TS.TimeStructure,
sp::Int64,
rp::Int64
sc::Int64,
)
Get the values from the JuMP model
, or the input data, at selection
for all periods in T
restricted to strategic period sp
, representative period rp
, and scenario sc
.
EnergyModelsGUI.get_default_colors
— Methodget_default_colors()
Get the default colors in the EnergyModelsGUI repository at src/colors.yml
.
EnergyModelsGUI.get_design
— Methodget_design(gui::GUI)
Returns the design
field of a GUI
gui
.
EnergyModelsGUI.get_element
— Methodget_element(conn::Connection)
Returns the assosiated Transmission
/Link
of conn
EnergyModelsGUI.get_element
— Methodget_element(system::System)
Returns the element
assosiated of a System
system
.
EnergyModelsGUI.get_element
— Methodget_element(design::EnergySystemDesign)
Returns the system node (i.e. availability node for areas) of a EnergySystemDesign
design
.
EnergyModelsGUI.get_element_label
— Methodget_element_label(element)
Get the label of the element based on its id
field. If the id
is a number it returns the built in Base.display() functionality of node, otherwise, the id
field is converted to a string.
EnergyModelsGUI.get_fig
— Methodget_fig(gui::GUI)
Returns the fig
field of a GUI
gui
.
EnergyModelsGUI.get_file
— Methodget_file(design::EnergySystemDesign)
Returns the file
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_from
— Methodget_from(conn::Connection)
Returns the from
field of a Connection
conn
.
EnergyModelsGUI.get_hover_string
— Methodget_hover_string(obj::AbstractGUIObj)
Return the string for a EMB.Node/Area/Link/Transmission to be shown on hovering.
EnergyModelsGUI.get_icon
— Methodget_icon(design::EnergySystemDesign)
Returns the icon
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_inv_data
— Methodget_inv_data(design::Connection)
Returns the inv_data
field of a Connection
design
.
EnergyModelsGUI.get_inv_data
— Methodget_inv_data(design::EnergySystemDesign)
Returns the inv_data
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_inv_times
— Methodget_inv_times(data::ProcInvData)
get_inv_times(design::AbstractGUIObj)
Returns the inv_times
field of a ProcInvData
/AbstractGUIObj
object data
.
EnergyModelsGUI.get_investment_times
— Methodget_investment_times(gui::GUI, max_inst::Float64)
Calculate when investments has taken place and store the information. An investement is assumed to have taken place if any investment_indicators
are larger than getvar(gui,:tol) relative to `maxinst`.
EnergyModelsGUI.get_jump_axis_types
— Methodget_jump_axis_types(data::JuMP.Containers.DenseAxisArray)
Get the types for each axis in the data.
EnergyModelsGUI.get_legend
— Methodget_legend(gui::GUI, key::Symbol)
Returns the legend
object key
of a GUI
gui
.
EnergyModelsGUI.get_linestyle
— Methodget_linestyle(::GUI, ::AbstractElement)
Dispatchable function for the EnergyModelsGeography extension.
EnergyModelsGUI.get_linestyle
— Methodget_linestyle(gui::GUI, connection::Connection)
Get the line style for an Connection connection
based on its properties.
EnergyModelsGUI.get_linestyle
— Methodget_linestyle(gui::GUI, design::EnergySystemDesign)
Get the line style for an EnergySystemDesign design
based on its properties.
EnergyModelsGUI.get_linked_nodes!
— Methodget_linked_nodes!(
node::EMB.Node,
links::Vector{Link},
area_links::Vector{Link},
area_nodes::Vector{EMB.Node},
indices::Vector{Int
)
Recursively find all nodes connected (directly or indirectly) to node
in a system of links
and store the found links in area_links
and nodes in area_nodes
.
Here, indices
contains the indices where the next link and node is to be stored, respectively.
EnergyModelsGUI.get_links
— Methodget_links(system::AbstractSystem)
Returns the ref_element
field of a AbstractSystem
system
.
EnergyModelsGUI.get_max_installed
— Methodget_max_installed(n, t::Vector{<:TS.TimeStructure})
Get the maximum capacity installable by an investemnt.
EnergyModelsGUI.get_menu
— Methodget_menu(gui::GUI, menu_name::Symbol)
Returns the menu
with name menu_name
of a GUI
gui
.
EnergyModelsGUI.get_menus
— Methodget_menus(gui::GUI)
Returns the menus
field of a GUI
gui
.
EnergyModelsGUI.get_mode_to_transmission_map
— Methodget_mode_to_transmission_map(::System)
Dispatchable function to get the mapping between modes and transmissions for a GeoSystem
.
EnergyModelsGUI.get_model
— Methodget_model(gui::GUI)
Returns the model
field of a GUI
gui
.
EnergyModelsGUI.get_nested_value
— Methodget_nested_value(dict::Dict, keys_str::String)
Get value of a nested
dict based on keys in the string key_str
separated by periods.
EnergyModelsGUI.get_nth_field
— Methodget_nth_field(s::String, delimiter::Char, n::Int)
Get n
'th value of a string s
separated by the character delimiter
.
EnergyModelsGUI.get_op
— Methodget_op(tp::TS.TimePeriod)
Get the operational period of TimePeriod tp
.
EnergyModelsGUI.get_parent
— Methodget_parent(system::AbstractSystem)
Returns the parent
field of a AbstractSystem
system
.
EnergyModelsGUI.get_parent
— Methodget_parent(design::EnergySystemDesign)
Returns the parent
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_parent
— Methodget_parent(gui::GUI)
Returns the parent
field of a GUI
gui
.
EnergyModelsGUI.get_periods
— Methodget_periods(T::TS.TimeStructure, type::Type, sp::Int64, rp::Int64, sc::Int64)
Get the periods for a given TimePeriod/TimeProfile type
(e.g., TS.StrategicPeriod, TS.RepresentativePeriod, TS.OperationalPeriod) restricted to the strategic period sp
, representative period rp
and the scenario sc
.
EnergyModelsGUI.get_plots
— Methodget_plots(conn::Connection)
Returns the plots
field of a Connection
conn
.
EnergyModelsGUI.get_plots
— Methodget_plots(design::EnergySystemDesign)
Returns the plots
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_plotted_data
— Methodget_plotted_data(gui::GUI)
Get the plots from the gui
.
EnergyModelsGUI.get_products
— Methodget_products(system::AbstractSystem)
Returns the vector of products of the AbstractSystem system
.
EnergyModelsGUI.get_ref_element
— Methodget_ref_element(system::AbstractSystem)
Returns the ref_element
field of a AbstractSystem
system
.
EnergyModelsGUI.get_ref_element
— Methodget_ref_element(design::EnergySystemDesign)
Returns the ref_element
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_representative_period_indices
— Methodget_representative_period_indices(T::TS.TimeStructure, sp::Int64)
Return indices in the time structure T
of the representative periods for strategic period sp
.
EnergyModelsGUI.get_resource_colors
— Methodget_resource_colors(l::Vector{Link}, id_to_color_map::Dict{Any,Any})
Get the colors linked to the resources in the link l
based on the mapping id_to_color_map
.
EnergyModelsGUI.get_resource_colors
— Methodget_resource_colors(resources::Vector{Resource}, id_to_color_map::Dict{Any,Any})
Get the colors linked the the resources in resources
based on the mapping id_to_color_map
.
EnergyModelsGUI.get_resource_colors
— Methodget_resource_colors(::Vector{Any}, ::Dict{Any,Any})
Return empty RGB vector for empty input.
EnergyModelsGUI.get_results_legend
— Methodget_results_legend(gui::GUI)
Get the legend from the current visible time axis from the gui
.
EnergyModelsGUI.get_root_design
— Methodget_root_design(gui::GUI)
Returns the root_design
field of a GUI
gui
.
EnergyModelsGUI.get_scenario_indices
— Methodget_scenario_indices(T::TS.TimeStructure, sp::Int64, rp::Int64)
Return indices of the scenarios in the time structure T
for strategic period number sp
and representative period rp
.
EnergyModelsGUI.get_sector_points
— Methodget_sector_points(;
center::Tuple{Real,Real} = (0.0, 0.0),
Δ::Real = 1.0,
θ₁::Real = 0,
θ₂::Real = π/4,
steps::Int=200,
geometry::Symbol = :circle)
Get points for the boundary of a sector defined by the center c
, radius/halfsidelength Δ
, and angles θ₁
and θ₂
for a square (geometry = :rect), a circle (geometry = :circle), or a triangle (geometry = :triangle).
EnergyModelsGUI.get_selected_plots
— Methodget_selected_plots(gui::GUI, time_axis::Symbol)
Get the selected plots from the gui
in the category time_axis
.
EnergyModelsGUI.get_selected_systems
— Methodget_selected_systems(gui::GUI)
Get the selected systems from the gui
.
EnergyModelsGUI.get_selection_color
— Methodget_selection_color(gui::GUI)
Get the selection color for the gui
.
EnergyModelsGUI.get_supertypes
— Methodget_supertypes(x::Any)
Return the vector of the supertypes of x
.
EnergyModelsGUI.get_system
— Methodget_system(design::EnergySystemDesign)
Returns the system
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_text_alignment
— Methodget_text_alignment(wall::Symbol)
Get the text alignment for a label attached to a wall.
EnergyModelsGUI.get_time_axis
— Methodget_time_axis(
data::Union{
JuMP.Containers.DenseAxisArray,
JuMP.Containers.SparseAxisArray,
SparseVariables.IndexedVarArray,
},
)
Get the index of the axis/column of data
(i.e. from a JuMP variable) corresponding to TS.TimePeriod and return this index (i_T
) alongside its TimeStruct type.
EnergyModelsGUI.get_time_struct
— Methodget_time_struct(system::AbstractSystem)
Returns the time structure of the AbstractSystem system
.
EnergyModelsGUI.get_time_struct
— Methodget_time_struct(design::EnergySystemDesign)
Returns the time structure of the EnergySystemDesign design
.
EnergyModelsGUI.get_time_struct
— Methodget_time_struct(gui::GUI)
Returns the time structure of the GUI gui
.
EnergyModelsGUI.get_to
— Methodget_to(conn::Connection)
Returns the to
field of a Connection
conn
.
EnergyModelsGUI.get_toggle
— Methodget_toggles(gui::GUI, toggle_name::Symbol)
Returns the toggle
with name toggle_name
of a GUI
gui
.
EnergyModelsGUI.get_topo_legend
— Methodget_topo_legend(gui::GUI)
Get the legend from the topology axis from the gui
.
EnergyModelsGUI.get_transmissions
— Methodget_transmissions(system::System)
Returns the Connections
s of a System
system
.
EnergyModelsGUI.get_var
— Methodget_var(gui::GUI, key::Symbol)
Returns the vars
field at key
of a GUI
gui
.
EnergyModelsGUI.get_vars
— Methodget_vars(gui::GUI)
Returns the vars
field of a GUI
gui
.
EnergyModelsGUI.get_vis_plots
— Methodget_vis_plots(ax::Axis)
Get visible BarPlots and Stairs plots.
EnergyModelsGUI.get_visible_data
— Methodget_visible_data(gui::GUI, time_axis::Symbol)
Get the visible plots from the gui
in the category time_axis
.
EnergyModelsGUI.get_wall
— Methodget_wall(design::EnergySystemDesign)
Returns the wall
field of a EnergySystemDesign
design
.
EnergyModelsGUI.get_xy
— Methodget_xy(design::EnergySystemDesign)
Returns the xy
field of a EnergySystemDesign
design
.
EnergyModelsGUI.getfirst
— Methodgetfirst(f::Function, a::Vector)
Return the first element of Vector a
satisfying the requirement of Function f
.
EnergyModelsGUI.has_invested
— Methodhas_invested(data::ProcInvData)
has_invested(data::AbstractGUIObj)
Returns a boolean indicator if investment has occured.
EnergyModelsGUI.includes_area
— Methodincludes_area(case::Case)
Check if the case includes elements from the EnergyModelsGeography package.
EnergyModelsGUI.initialize_available_data!
— Methodinitialize_available_data!(gui)
For all plotable objects, initialize the available data menu with items.
EnergyModelsGUI.initialize_plot!
— Methodinitialize_plot!(gui::GUI, design::EnergySystemDesign)
Initialize the plot of the topology of design object gui
given an EnergySystemDesign design
.
EnergyModelsGUI.installed
— Methodfunction installed()
Get a list of installed packages (from the depricated Pkg.installed()).
EnergyModelsGUI.l2_norm
— Methodl2_norm(x::Vector{<:Real})
Compute the l2-norm of a vector.
EnergyModelsGUI.merge_dicts
— Methodmerge_dicts(dict1::Dict, dict2::Dict)
Merge dict1
and dict2
(in case of overlap, dict2
overwrites entries in dict1
).
EnergyModelsGUI.merge_svg_strings
— Methodmerge_svg_strings(svg1, svg2)
Merge two SVG strings svg1
and svg2
into one with header from svg1
.
EnergyModelsGUI.mouse_within_axis
— Methodmouse_within_axis(ax::Makie.AbstractAxis, mouse_pos::Tuple{Float64,Float64})
Check if mouse position is within the pixel area of ax
.
EnergyModelsGUI.nested_eltype
— Methodnested_eltype(x::TimeProfile)
Return the type of the lowest TimeProfile, of a nested TimeProfile x
, not being a FixedProfile.
EnergyModelsGUI.new_global_delta_h
— Methodnew_global_delta_h(gui::GUI)
Recalculate the sizes of the boxes in get_axes(gui)[:topo]
such that their size is independent of zooming an resizing the window.
EnergyModelsGUI.parse_case
— Methodparse_case(case::Case)
Parse the case and return a AbstractSystem
instance.
EnergyModelsGUI.pick_component!
— Methodpick_component!(gui::GUI)
Check if a system is found under the mouse pointer and if it is an EnergySystemDesign
or a Connection
and update state variables.
EnergyModelsGUI.pixel_to_data
— Methodpixel_to_data(gui::GUI, pixel_size::Real)
Convert pixel_size
to data widths (in x- and y-direction) in design object gui
.
EnergyModelsGUI.place_nodes_in_circle
— Methodplace_nodes_in_circle(total_nodes::Int, current_node::Int, r::Real, xₒ::Real, yₒ::Real)
Return coordinate for point number i
of a total of n
points evenly distributed around a circle of radius r
centered at (xₒ, yₒ) from -π/4 to 5π/4.
EnergyModelsGUI.plot_design!
— Methodplot_design!(
gui::GUI, design::EnergySystemDesign; visible::Bool=true, expand_all::Bool=true
)
Plot the topology of get_design(gui) (only if not already available), and toggle visibility based on the optional argument visible
.
EnergyModelsGUI.print_nested_structure!
— Methodprint_nested_structure!(
element,
output;
indent::Int64=0,
vector_limit::Int64=typemax(Int64),
)
Appends the nested structure of element in a nice format to the output[] string. The parameter vector_limit
is used to truncate large vectors.
EnergyModelsGUI.save_design
— Methodsave_design(design::EnergySystemDesign, file::String)
Save the x,y-coordinates of design_dict
to a .yml file at location and filename given by file
.
EnergyModelsGUI.save_design
— Methodsave_design(design::EnergySystemDesign)
Save the x,y-coordinates of EnergySystemDesign design
to a .yml file specifield in the field file
of design
.
EnergyModelsGUI.scroll_ylim
— Methodscroll_ylim(ax::Makie.AbstractAxis, val::Float64)
Shift the ylim with val
units to mimic scrolling feature of an axis ax
.
EnergyModelsGUI.select_data!
— Methodselect_data(name::String, menu)
Select the data with name name
from the menu
EnergyModelsGUI.square_intersection
— Methodsquare_intersection(
c::Tuple{Tc, Tc},
θ::Tθ, Δ::TΔ
) where {Tc<:Real, Tx<:Real, Tθ<:Real, TΔ<:Real}
Calculate the intersection point between a line starting at c
and direction described by θ
and a square with half side lengths Δ
centered at center c
.
EnergyModelsGUI.square_intersection
— Methodsquare_intersection(
c::Vector{Tc}, x::Vector{Tx},
θ::Tθ, Δ::TΔ
) where {Tc<:Real, Tx<:Real, Tθ<:Real, TΔ<:Real}
Calculate the intersection point between a line starting at x
and direction described by θ
and a square with half side lengths Δ
centered at center c
.
EnergyModelsGUI.sub_system
— Methodsub_system(system::SystemGeo, element::AbstractElement)
Create a sub-system of system
with the element
as the reference node.
EnergyModelsGUI.toggle_inspector!
— Methodtoggle_inspector!(p::Makie.AbstractPlot, toggle::Bool)
Toggle the inspector of a Makie plot p
using the boolean toggle
.
EnergyModelsGUI.toggle_selection_color!
— Methodtoggle_selection_color!(gui::GUI, selection, selected::Bool)
Set the color of selection to get_selection_color(gui)
if selected, and its original color otherwise using the argument selected
.
EnergyModelsGUI.update!
— Methodupdate!(gui::GUI, element; updateplot::Bool=true)
Based on element
, update the text in get_axes(gui)[:info]
and update plot in get_axes(gui)[:results]
if updateplot = true
.
EnergyModelsGUI.update!
— Methodupdate!(gui::GUI, connection::Connection; updateplot::Bool=true)
Based on Connection
, update the text in get_axes(gui)[:info]
and update plot in get_axes(gui)[:results]
if updateplot = true
.
EnergyModelsGUI.update!
— Methodupdate!(gui::GUI, design::EnergySystemDesign; updateplot::Bool=true)
Based on design
, update the text in get_axes(gui)[:info]
and update plot in get_axes(gui)[:results]
if updateplot = true
.
EnergyModelsGUI.update!
— Methodupdate!(gui::GUI)
Upon release of left mouse button update plots.
EnergyModelsGUI.update_available_data_menu!
— Methodupdate_available_data_menu!(gui::GUI, element)
Update the get_menus(gui)[:available_data]
with the available data of element
.
EnergyModelsGUI.update_axis!
— Methodupdate_axislabels!(gui::GUI, time_axis::Symbol)
Update the xlabel, ylabel and ticks of the :results axis
EnergyModelsGUI.update_barplot_dodge!
— Methodupdate_barplot_dodge!(gui::GUI)
Update the barplot of the state of the GUI (such that the bars are dodged away from each other).
EnergyModelsGUI.update_descriptive_names!
— Methodupdate_descriptive_names!(gui::GUI)
Update the dictionary of descriptive_names
where the Dict is appended/overwritten in the following order:
- The default descriptive names found in
src/descriptive_names.yml
. - Any descriptive_names.yml file found in the ext/EMGUIExt folder of any other EMX package.
- Descriptive names from a user defined file (from the GUI input argument
path_to_descriptive_names
). - Descriptive names from a user defined Dict (from the GUI input argument
descriptive_names_dict
).
EnergyModelsGUI.update_distances!
— Methodupdate_distances!(gui::GUI)
Find the minimum distance between the elements in the design object gui
and update Δh
such that neighbouring icons do not overlap.
EnergyModelsGUI.update_info_box!
— Methodupdate_info_box!(gui::GUI, element; indent::Int64=0)
Based on element
update the text in info box.
EnergyModelsGUI.update_legend!
— Methodupdate_legend!(gui::GUI)
Update the legend based on the visible plots of type time_axis
.
EnergyModelsGUI.update_limits!
— Methodupdate_limits!(ax::Axis, limits::GLMakie.HyperRectangle)
Set the limits based on limits.
EnergyModelsGUI.update_limits!
— Methodupdate_limits!(ax::Axis)
Adjust limits automatically to take into account legend and machine epsilon issues.
EnergyModelsGUI.update_plot!
— Methodupdate_plot!(gui::GUI)
Based on selected_systems
update plots.
EnergyModelsGUI.update_plot!
— Methodupdate_plot!(gui::GUI, element)
Based on element
update the results in get_axes(gui)[:results]
.
EnergyModelsGUI.update_plot!
— Methodupdate_plot!(gui::GUI, design::EnergySystemDesign)
Based on connection
update plots.
EnergyModelsGUI.update_plot!
— Methodupdate_plot!(gui::GUI, design::EnergySystemDesign)
Based on design
update plots.
EnergyModelsGUI.update_sub_system_locations!
— Methodupdate_sub_system_locations!(design::EnergySystemDesign, Δ::Tuple{Real,Real})
Update the coordinates of a subsystem of design based on the movement of EnergySystemDesign design
.
EnergyModelsGUI.update_title!
— Methodupdate_title!(gui::GUI)
Update the title of get_axes(gui)[:topo]
based on get_design(gui)
.