Internals
Index
EnergyModelsGUI.AbstractGUIObjEnergyModelsGUI.AbstractSystemEnergyModelsGUI.ConnectionEnergyModelsGUI.EnergySystemIteratorEnergyModelsGUI.NothingDesignEnergyModelsGUI.NothingElementEnergyModelsGUI.PlotContainerEnergyModelsGUI.ProcInvDataEnergyModelsGUI.SystemEnergyModelsGUI.SystemGeoBase.iterateEnergyModelsBase.get_elements_vecEnergyModelsBase.get_linksEnergyModelsBase.get_nodesEnergyModelsBase.get_productsEnergyModelsBase.get_time_structEnergyModelsBase.get_time_structEnergyModelsBase.get_time_structEnergyModelsGUI._type_to_headerEnergyModelsGUI.add_component!EnergyModelsGUI.add_description!EnergyModelsGUI.add_description!EnergyModelsGUI.add_description!EnergyModelsGUI.add_description!EnergyModelsGUI.add_inspector_to_poly!EnergyModelsGUI.adjust_limits!EnergyModelsGUI.alignEnergyModelsGUI.angleEnergyModelsGUI.angle_differenceEnergyModelsGUI.boxEnergyModelsGUI.clear_selectionEnergyModelsGUI.closeEnergyModelsGUI.connect!EnergyModelsGUI.connect!EnergyModelsGUI.convert_arrayEnergyModelsGUI.create_descriptionEnergyModelsGUI.create_labelEnergyModelsGUI.create_makie_objectsEnergyModelsGUI.define_event_functionsEnergyModelsGUI.design_fileEnergyModelsGUI.draw_box!EnergyModelsGUI.draw_icon!EnergyModelsGUI.draw_label!EnergyModelsGUI.export_svgEnergyModelsGUI.export_to_fileEnergyModelsGUI.export_to_replEnergyModelsGUI.export_xlsxEnergyModelsGUI.export_xlsxEnergyModelsGUI.extract_data_selectionEnergyModelsGUI.extract_svgEnergyModelsGUI.find_iconEnergyModelsGUI.find_min_max_coordinatesEnergyModelsGUI.find_min_max_coordinatesEnergyModelsGUI.find_type_fieldEnergyModelsGUI.format_numberEnergyModelsGUI.get_EMGUI_objEnergyModelsGUI.get_JuMP_dictEnergyModelsGUI.get_JuMP_namesEnergyModelsGUI.get_all_periods!EnergyModelsGUI.get_available_dataEnergyModelsGUI.get_axEnergyModelsGUI.get_axesEnergyModelsGUI.get_buttonEnergyModelsGUI.get_capexEnergyModelsGUI.get_changeEnergyModelsGUI.get_childrenEnergyModelsGUI.get_colorEnergyModelsGUI.get_colorsEnergyModelsGUI.get_combinationsEnergyModelsGUI.get_componentEnergyModelsGUI.get_componentsEnergyModelsGUI.get_connectionsEnergyModelsGUI.get_connectionsEnergyModelsGUI.get_dataEnergyModelsGUI.get_default_colorsEnergyModelsGUI.get_descriptionEnergyModelsGUI.get_designEnergyModelsGUI.get_elementEnergyModelsGUI.get_elementEnergyModelsGUI.get_elementEnergyModelsGUI.get_element_labelEnergyModelsGUI.get_field_dataEnergyModelsGUI.get_figEnergyModelsGUI.get_fileEnergyModelsGUI.get_fromEnergyModelsGUI.get_hover_stringEnergyModelsGUI.get_iconEnergyModelsGUI.get_inv_dataEnergyModelsGUI.get_inv_timesEnergyModelsGUI.get_investment_timesEnergyModelsGUI.get_jump_axis_typesEnergyModelsGUI.get_legendEnergyModelsGUI.get_linestyleEnergyModelsGUI.get_linestyleEnergyModelsGUI.get_linestyleEnergyModelsGUI.get_max_installedEnergyModelsGUI.get_menuEnergyModelsGUI.get_menusEnergyModelsGUI.get_mode_to_transmission_mapEnergyModelsGUI.get_modelEnergyModelsGUI.get_nameEnergyModelsGUI.get_nested_valueEnergyModelsGUI.get_nth_fieldEnergyModelsGUI.get_obj_valueEnergyModelsGUI.get_opEnergyModelsGUI.get_parentEnergyModelsGUI.get_parentEnergyModelsGUI.get_parentEnergyModelsGUI.get_periodsEnergyModelsGUI.get_plotablesEnergyModelsGUI.get_plotsEnergyModelsGUI.get_plotted_dataEnergyModelsGUI.get_ref_elementEnergyModelsGUI.get_ref_elementEnergyModelsGUI.get_repr_dictEnergyModelsGUI.get_representative_period_indicesEnergyModelsGUI.get_resource_colorsEnergyModelsGUI.get_resource_colorsEnergyModelsGUI.get_resource_colorsEnergyModelsGUI.get_results_legendEnergyModelsGUI.get_root_designEnergyModelsGUI.get_scenario_indicesEnergyModelsGUI.get_screenEnergyModelsGUI.get_sector_pointsEnergyModelsGUI.get_selected_plotsEnergyModelsGUI.get_selected_systemsEnergyModelsGUI.get_selectionEnergyModelsGUI.get_selection_colorEnergyModelsGUI.get_supertypesEnergyModelsGUI.get_supertypesEnergyModelsGUI.get_systemEnergyModelsGUI.get_systemEnergyModelsGUI.get_text_alignmentEnergyModelsGUI.get_time_axisEnergyModelsGUI.get_toEnergyModelsGUI.get_toggleEnergyModelsGUI.get_topo_legendEnergyModelsGUI.get_total_sum_timeEnergyModelsGUI.get_typesEnergyModelsGUI.get_types_structureEnergyModelsGUI.get_valuesEnergyModelsGUI.get_varEnergyModelsGUI.get_varsEnergyModelsGUI.get_vis_plotsEnergyModelsGUI.get_visible_dataEnergyModelsGUI.get_wallEnergyModelsGUI.get_xyEnergyModelsGUI.getfirstEnergyModelsGUI.has_fieldsEnergyModelsGUI.has_investedEnergyModelsGUI.includes_areaEnergyModelsGUI.inherit_descriptive_names_from_supertypes!EnergyModelsGUI.initialize_available_data!EnergyModelsGUI.initialize_plot!EnergyModelsGUI.installedEnergyModelsGUI.l2_normEnergyModelsGUI.loadedEnergyModelsGUI.merge_dictsEnergyModelsGUI.merge_svg_stringsEnergyModelsGUI.mouse_within_axisEnergyModelsGUI.nested_eltypeEnergyModelsGUI.new_global_delta_hEnergyModelsGUI.parse_caseEnergyModelsGUI.parse_colorEnergyModelsGUI.pick_component!EnergyModelsGUI.pixel_to_dataEnergyModelsGUI.place_nodes_in_circleEnergyModelsGUI.plot_design!EnergyModelsGUI.print_nested_structure!EnergyModelsGUI.results_availableEnergyModelsGUI.save_designEnergyModelsGUI.save_designEnergyModelsGUI.scroll_ylimEnergyModelsGUI.select_data!EnergyModelsGUI.square_intersectionEnergyModelsGUI.square_intersectionEnergyModelsGUI.sub_systemEnergyModelsGUI.toggle_selection_color!EnergyModelsGUI.transfer_modelEnergyModelsGUI.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!EnergyModelsGUI.update_tree!
Types
EnergyModelsGUI.AbstractGUIObj — Type
AbstractGUIObjSupertype for EnergyModelsGUI objects representing Nodes/Links/Areas/Transmissions.
EnergyModelsGUI.Connection — Type
Connection <: AbstractGUIObjMutable type for providing a flexible data structure for connections between EnergySystemDesigns.
Fields
from::EnergySystemDesignis theEnergySystemDesignfrom which the connection originates.to::EnergySystemDesignis theEnergySystemDesignto which the connection is linked to.connection::AbstractElementis the EMX connection structure.colors::Vector{RGBA{Float32}}is the associated colors of the connection.plots::Vector{Any}is a vector with all Makie object associated with this object.invest_data::ProcInvDatastores processed investment data.
EnergyModelsGUI.EnergySystemIterator — Type
EnergySystemIteratorType for iterating over nested EnergySystemDesign structures, enabling recursion through AbstractGUIObjs.
Fields
stack::Vector{<:AbstractGUIObj}is the stack used to manage the iteration through the nestedEnergySystemDesigncomponents (and its connections). It starts with the initialEnergySystemDesignobject and progressively includes its subcomponents as the iteration proceeds.
EnergyModelsGUI.NothingElement — Type
NothingElement <: AbstractElementType for representing an empty Element (the "nothing" element).
sourceEnergyModelsGUI.PlotContainer — Type
PlotContainer{T}Type for storing plot-related data available from the "Data" menu.
Fields
name::String: is the reference name for the data.selection::Vector: is the indices used to extract the data to be plotted.field_data::Any: is the data from which plots are extracted based on selection.description::String: is the description to be used for the legend.
EnergyModelsGUI.ProcInvData — Type
ProcInvDataType 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::Boolindicates if the element has been invested in.
EnergyModelsGUI.System — Type
SystemType for storing processed system data from EnergyModelsBase.
Fields
T::TimeStructureis 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 ofAbstractElementthat 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::AbstractElementis the parent of the system (e.g., theAreanode of the referenceGeoAvailabilitynode).ref_element::AbstractElementis the reference element of the system (firstAvailabilitynode).
EnergyModelsGUI.SystemGeo — Type
SystemGeoType for storing processed system data from EnergyModelsGeography.
Fields
T::TimeStructureis 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 ofAbstractElementthat 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::AbstractElementis the parent of the system.ref_element::AbstractElementis the reference element of the system.
Functions
Base.iterate — Function
iterate(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 — Method
EMB.get_elements_vec(system::AbstractSystem)Returns the vector of element-vectors of the AbstractSystem system.
EnergyModelsBase.get_links — Method
EnergyModelsBase.get_nodes — Method
EnergyModelsBase.get_products — Method
EMB.get_products(system::AbstractSystem)Returns the vector of products of the AbstractSystem system.
EnergyModelsBase.get_time_struct — Method
EMB.get_time_struct(system::AbstractSystem)Returns the time structure of the AbstractSystem system.
EnergyModelsBase.get_time_struct — Method
EMB.get_time_struct(design::EnergySystemDesign)Returns the time structure of the EnergySystemDesign design.
EnergyModelsBase.get_time_struct — Method
EnergyModelsGUI._type_to_header — Method
_type_to_header(::Type{<:TS.AbstractStrategicPeriod})
_type_to_header(::Type{<:TS.AbstractRepresentativePeriod})
_type_to_header(::Type{<:TS.AbstractOperationalScenario})
_type_to_header(::Type{<:TS.TimePeriod})
_type_to_header(::Type{<:TS.TimeStructure})
_type_to_header(::Type{<:Resource})
_type_to_header(::Type{<:AbstractElement})Map types to header symbols for saving results.
sourceEnergyModelsGUI.add_component! — Method
add_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! — Method
add_description!(
field::Any,
name::String,
::String,
pre_desc::String,
element,
available_data::Vector{PlotContainer},
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! — Method
add_description!(
field::Dict,
name::String,
key_str::String,
pre_desc::String,
selection::Vector,
available_data::Vector{PlotContainer},
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! — Method
add_description!(
field::TS.TimeProfile,
name::String,
key_str::String,
pre_desc::String,
selection::Vector,
available_data::Vector{PlotContainer},
gui::GUI,
)Create a container with a description, and add container to available_data.
EnergyModelsGUI.add_description! — Method
add_description!(
field::Vector,
name::String,
key_str::String,
pre_desc::String,
selection::Vector,
available_data::Vector{PlotContainer},
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! — Method
add_inspector_to_poly!(p::Makie.AbstractPlot, inspector_label::Function)Add inspector_label for Poly and Mesh plots in plot p.
EnergyModelsGUI.adjust_limits! — Method
EnergyModelsGUI.align — Method
align(gui::GUI, align::Symbol)Align components in get_selected_systems(gui) based on the value of Symbol align.
The following values are allowed
:horizontalfor horizontal alignment.:verticalfor vertical alignment.
EnergyModelsGUI.angle — Method
angle(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 — Method
EnergyModelsGUI.box — Method
function box(x::Float32, y::Float32, Δ::Float32)Get the coordinates of a box with half side lengths Δ and centered at (x,y) starting at the upper right corner.
EnergyModelsGUI.clear_selection — Method
clear_selection(gui::GUI, ax_type::Symbol)Clear the color selection of the topology axis if ax_type = :topo, and of the results axis if ax_type = :results.
EnergyModelsGUI.close — Method
EnergyModelsGUI.connect! — Method
connect!(gui::GUI, connection::Connection, two_way::Bool)When a boolean argument two_way is specified, draw the lines in both directions.
EnergyModelsGUI.connect! — Method
connect!(gui::GUI, design::EnergySystemDesign)Draws lines between connected nodes/areas in GUI gui using EnergySystemDesign design.
EnergyModelsGUI.convert_array — Method
convert_array(v::AbstractArray, dict::Dict)Apply the transformation of the dict to the array v.
EnergyModelsGUI.create_description — Method
create_description(
gui::GUI,
key_str::String;
pre_desc::String="",
)Create description from get_var(gui,:descriptive_names) if available
EnergyModelsGUI.create_label — Method
create_label(selection::PlotContainer)Return a label for a given selection to be used in the getmenus(gui)[:availabledata] menu.
EnergyModelsGUI.create_makie_objects — Method
create_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 — Method
define_event_functions(gui::GUI)Define event functions (handling button clicks, plot updates, etc.) for the GUI gui.
EnergyModelsGUI.design_file — Method
design_file(system::AbstractSystem, path::String)Construct the path for the .yml file for system in the folder path.
EnergyModelsGUI.draw_box! — Method
draw_box!(gui::GUI, design::EnergySystemDesign)Draw a box for EnergySystemDesign design and it's appearance, including style, color, size.
EnergyModelsGUI.draw_icon! — Method
EnergyModelsGUI.draw_label! — Method
draw_label!(gui::GUI, component::EnergySystemDesign)Add a label to an EnergySystemDesign component.
EnergyModelsGUI.export_svg — Method
export_svg(ax::Makie.Block, filename::String)Export the ax to a .svg file with path given by filename.
EnergyModelsGUI.export_to_file — Method
EnergyModelsGUI.export_to_repl — Method
EnergyModelsGUI.export_xlsx — Method
export_xlsx(gui::GUI, filename::String)Export the JuMP fields to an xlsx file with path given by filename.
EnergyModelsGUI.export_xlsx — Method
export_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 — Method
extract_data_selection(var::SparseVars, selection::Vector, i_T::Int64, periods::Vector)
extract_data_selection(var::Jump.Containers.DenseAxisArray, selection::Vector, i_T::Int64, ::Vector)
extract_data_selection(var::DataFrame, selection::Vector, ::Int64, ::Vector)Extract data from var having its time dimension at index i_T for all time periods in periods.
This function does not support more than three indices for var::DataFrame (i.e., when model results are read from CSV-files). This implies it is incompatible with potential extensions that introduce more than three indices for variables.
EnergyModelsGUI.extract_svg — Method
EnergyModelsGUI.find_icon — Method
find_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 — Method
find_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 — Method
find_min_max_coordinates(design::EnergySystemDesign)Find the minimum and maximum coordinates of the components of EnergySystemDesign design.
EnergyModelsGUI.find_type_field — Method
EnergyModelsGUI.format_number — Method
EnergyModelsGUI.get_EMGUI_obj — Method
get_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_dict — Method
get_JuMP_dict(model::Model)
get_JuMP_dict(model::Dict)Get the dictionary of the model results. If the model is a JuMP.Model, it returns the object dictionary.
sourceEnergyModelsGUI.get_JuMP_names — Method
get_JuMP_names(gui::GUI)Get all names registered in the model as a vector except the names to be ignored.
sourceEnergyModelsGUI.get_all_periods! — Method
get_all_periods!(vec::Vector, ts::TwoLevel)
get_all_periods!(vec::Vector, ts::RepresentativePeriods)
get_all_periods!(vec::Vector, ts::OperationalScenarios)
get_all_periods!(vec::Vector, ts::Any)Get all TimeStructures in ts and append them to vec.
EnergyModelsGUI.get_available_data — Method
EnergyModelsGUI.get_ax — Method
EnergyModelsGUI.get_axes — Method
EnergyModelsGUI.get_button — Method
get_button(gui::GUI, button_name::Symbol)Returns the button with name button_name of a GUI gui.
EnergyModelsGUI.get_capex — Method
get_capex(data::ProcInvData)
get_capex(design::AbstractGUIObj)Returns the capex of the investments of a ProcInvData/AbstractGUIObj object data.
EnergyModelsGUI.get_change — Method
get_change(::GUI, ::Val)Handle different keyboard inputs (events) and return changes in x, y coordinates in the design object gui.
EnergyModelsGUI.get_children — Method
EnergyModelsGUI.get_color — Method
EnergyModelsGUI.get_colors — Method
EnergyModelsGUI.get_combinations — Method
get_combinations(var::SparseVars, i_T::Int)
get_combinations(var::JuMP.Containers.DenseAxisArray, i_T::Int)
get_combinations(var::DataFrame, ::Int)Get an iterator of combinations of unique indices excluding the time index located at index i_T.
EnergyModelsGUI.get_component — Method
get_component(designs::Vector{EnergySystemDesign}, id)
get_component(designs::EnergySystemDesign, id)Extract the component from a vector of EnergySystemDesign(s) that has a parent with the given id.
EnergyModelsGUI.get_components — Method
get_components(design::EnergySystemDesign)Returns the components field of a EnergySystemDesign design.
EnergyModelsGUI.get_connections — Method
get_connections(system::AbstractSystem)Returns the connections field of a AbstractSystem system.
EnergyModelsGUI.get_connections — Method
get_connections(design::EnergySystemDesign)Returns the connections field of a EnergySystemDesign design.
EnergyModelsGUI.get_data — Method
get_data(
model::Union{JuMP.Model, Dict},
selection::PlotContainer,
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 — Method
get_default_colors()Get the default colors in the EnergyModelsGUI repository at src/colors.yml.
EnergyModelsGUI.get_description — Method
get_description(container::PlotContainer)Returns the description field of a PlotContainer container.
EnergyModelsGUI.get_design — Method
EnergyModelsGUI.get_element — Method
EnergyModelsGUI.get_element — Method
EnergyModelsGUI.get_element — Method
get_element(design::EnergySystemDesign)Returns the system node (i.e., availability node for areas) of a EnergySystemDesign design.
EnergyModelsGUI.get_element_label — Method
get_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_field_data — Method
get_field_data(container::PlotContainer)Returns the field_data field of a PlotContainer container.
EnergyModelsGUI.get_fig — Method
EnergyModelsGUI.get_file — Method
EnergyModelsGUI.get_from — Method
EnergyModelsGUI.get_hover_string — Method
get_hover_string(obj::AbstractGUIObj)Return the string for a EMB.Node/Area/Link/Transmission to be shown on hovering.
sourceEnergyModelsGUI.get_icon — Method
EnergyModelsGUI.get_inv_data — Method
EnergyModelsGUI.get_inv_times — Method
get_inv_times(data::ProcInvData)
get_inv_times(design::AbstractGUIObj)Returns the inv_times field of a ProcInvData/AbstractGUIObj object data.
EnergyModelsGUI.get_investment_times — Method
get_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 — Method
get_jump_axis_types(data::JuMP.Containers.DenseAxisArray)
get_jump_axis_types(data::SparseVars)
get_jump_axis_types(data::DataFrame)Get the types for each axis in the data.
sourceEnergyModelsGUI.get_legend — Method
EnergyModelsGUI.get_linestyle — Method
get_linestyle(::GUI, ::AbstractElement)Dispatchable function for the EnergyModelsGeography extension.
sourceEnergyModelsGUI.get_linestyle — Method
get_linestyle(gui::GUI, connection::Connection)Get the line style for an Connection connection based on its properties.
EnergyModelsGUI.get_linestyle — Method
get_linestyle(gui::GUI, design::EnergySystemDesign)Get the line style for an EnergySystemDesign design based on its properties.
EnergyModelsGUI.get_max_installed — Method
get_max_installed(n, t::Vector{<:TS.TimeStructure})Get the maximum capacity installable by an investemnt.
sourceEnergyModelsGUI.get_menu — Method
EnergyModelsGUI.get_menus — Method
EnergyModelsGUI.get_mode_to_transmission_map — Method
get_mode_to_transmission_map(::System)Dispatchable function to get the mapping between modes and transmissions for a GeoSystem.
EnergyModelsGUI.get_model — Method
EnergyModelsGUI.get_name — Method
EnergyModelsGUI.get_nested_value — Method
get_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 — Method
get_nth_field(s::String, delimiter::Char, n::Int)Get n'th value of a string s separated by the character delimiter.
EnergyModelsGUI.get_obj_value — Method
EnergyModelsGUI.get_op — Method
EnergyModelsGUI.get_parent — Method
EnergyModelsGUI.get_parent — Method
get_parent(design::EnergySystemDesign)Returns the parent field of a EnergySystemDesign design.
EnergyModelsGUI.get_parent — Method
EnergyModelsGUI.get_periods — Method
get_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_plotables — Method
EnergyModelsGUI.get_plots — Method
EnergyModelsGUI.get_plotted_data — Method
EnergyModelsGUI.get_ref_element — Method
get_ref_element(system::AbstractSystem)Returns the ref_element field of a AbstractSystem system.
EnergyModelsGUI.get_ref_element — Method
get_ref_element(design::EnergySystemDesign)Returns the ref_element field of a EnergySystemDesign design.
EnergyModelsGUI.get_repr_dict — Method
get_repr_dict(vec::AbstractVector{T}) where TGet a dictionary with the string representation of each element in vec as keys.
EnergyModelsGUI.get_representative_period_indices — Method
get_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 — Method
get_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 — Method
get_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 — Method
get_resource_colors(::Vector{Any}, ::Dict{Any,Any})Return empty RGBA{Float32} vector for empty input.
sourceEnergyModelsGUI.get_results_legend — Method
EnergyModelsGUI.get_root_design — Method
EnergyModelsGUI.get_scenario_indices — Method
get_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_screen — Method
EnergyModelsGUI.get_sector_points — Method
get_sector_points(;
center::Point2f = Point2f(0.0f0, 0.0f0),
Δ::Float32 = 1.0f0,
θ₁::Float32 = 0.0f0,
θ₂::Float32 = Float32(π / 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 — Method
get_selected_plots(gui::GUI, time_axis::Symbol)Get the selected plots from the gui in the category time_axis.
EnergyModelsGUI.get_selected_systems — Method
EnergyModelsGUI.get_selection — Method
get_selection(container::PlotContainer)Returns the selection field of a PlotContainer container.
EnergyModelsGUI.get_selection_color — Method
EnergyModelsGUI.get_supertypes — Method
EnergyModelsGUI.get_supertypes — Method
get_supertypes(input) -> Dict{Symbol, Vector{Type}}Retrieves the supertypes of all defined types from modules or packages.
Method Overloads
get_supertypes(modul::Module): Returns a dictionary mapping type names to their supertypes from the given module.get_supertypes(moduls::Vector{Module}): Merges and returns supertypes from multiple modules.get_supertypes(pkg::Union{String, Symbol}): Converts the package name to a module (viaMain) and returns its type supertypes.get_supertypes(pkgs::Union{Vector{<:Union{String, Symbol}}, Set{<:Union{String, Symbol}}}): Merges and returns supertypes from multiple packages via their names.
Arguments
input: Can be a single module, a vector of modules, a single package name (asStringorSymbol), or a collection of package names.
Returns
Dict{Symbol, Vector{Type}}: A dictionary where each key is a type name and the value is a vector of its supertypes.
Description
This set of functions helps extract the inheritance hierarchy of types defined in Julia modules or packages. It filters out non-type bindings and collects supertypes using supertypes.
EnergyModelsGUI.get_system — Method
get_system(design::EnergySystemDesign)Returns the system field of a EnergySystemDesign design.
EnergyModelsGUI.get_system — Method
EnergyModelsGUI.get_text_alignment — Method
EnergyModelsGUI.get_time_axis — Method
get_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_to — Method
EnergyModelsGUI.get_toggle — Method
get_toggles(gui::GUI, toggle_name::Symbol)Returns the toggle with name toggle_name of a GUI gui.
EnergyModelsGUI.get_topo_legend — Method
EnergyModelsGUI.get_total_sum_time — Method
get_total_sum_time(data::JuMP.Containers.DenseAxisArray, ::Vector{<:TS.TimeStructure})
get_total_sum_time(data::DataFrame, periods::Vector{<:TS.TimeStructure})Get the total sum of the data for each time period in data.
EnergyModelsGUI.get_types — Method
get_types(input) -> Vector{Symbol}Retrieves the names of all defined types from modules or packages.
Method Overloads
get_types(modul::Module): Returns a vector of type names defined in the given module.get_types(moduls::Vector{Module}): Returns a combined vector of type names from multiple modules.get_types(pkg::Union{String, Symbol}): Converts the package name to a module (viaMain) and returns its defined types.get_types(pkgs::Union{Vector{<:Union{String, Symbol}}, Set{<:Union{String, Symbol}}}): Returns a combined vector of type names from multiple packages.
Arguments
input: Can be a single module, a vector of modules, a single package name (asStringorSymbol), or a collection of package names.
Returns
Vector{Symbol}: A list of names corresponding to types defined in the given module(s) or package(s).
Description
This set of functions helps extract type definitions from Julia modules or packages. It filters out non-type bindings and collects only those that are instances of DataType.
Example
get_types(Base) # returns type names defined in Base
get_types(["Base", "Core"]) # returns type names from both packagessourceEnergyModelsGUI.get_types_structure — Method
get_types_structure(emx_supertypes_dict::Dict{Any, Vector{Type}}) -> Dict{Type, Union{Dict, Nothing}}Constructs a nested dictionary representing type dependencies from a dictionary of supertypes.
Arguments
emx_supertypes_dict::Dict{Any, Vector{Type}}: A dictionary where each key corresponds to a type identifier, and the value is a vector of supertypes ordered from the most general to the most specific.
Returns
Dict{Type, Union{Dict, Nothing}}: A nested dictionary structure where each type is a key pointing to its subtype hierarchy. Leaf nodes point tonothing.
Description
This function builds a tree-like structure of type dependencies by iterating through each type's supertypes and nesting them accordingly. It uses the helper function update_tree! to insert types into the correct level of the hierarchy. ```
EnergyModelsGUI.get_values — Method
get_values(vals::SparseVars)
get_values(vals::JuMP.Containers.DenseAxisArray)
get_values(vals::DataFrame)
get_values(vals::JuMP.Containers.SparseAxisArray, ts::Vector)
get_values(vals::SparseVariables.IndexedVarArray, ts::Vector)
get_values(vals::JuMP.Containers.DenseAxisArray, ts::Vector)
get_values(vals::DataFrame, ts::Vector)Get the values of the variables in vals. If a vector of time periods ts is provided, it returns the values for the times in ts.
EnergyModelsGUI.get_var — Method
EnergyModelsGUI.get_vars — Method
EnergyModelsGUI.get_vis_plots — Method
EnergyModelsGUI.get_visible_data — Method
get_visible_data(gui::GUI, time_axis::Symbol)Get the visible plots from the gui in the category time_axis.
EnergyModelsGUI.get_wall — Method
EnergyModelsGUI.get_xy — Method
EnergyModelsGUI.getfirst — Method
getfirst(f::Function, a::Vector)Return the first element of Vector a satisfying the requirement of Function f.
EnergyModelsGUI.has_fields — Method
has_fields(type::Type) -> BoolChecks whether a given type is a concrete struct with at least one field.
Arguments
type::Type: The type to be inspected.
Returns
Bool: Returnstrueif the type is a concrete struct and has one or more fields; otherwise, returnsfalse.
Description
This function combines three checks:
isstructtype(type): Ensures the type is a struct.nfields(type) > 0: Ensures the struct has at least one field.
Example
struct MyStruct
x::Int
end
has_fields(MyStruct) # returns true
abstract type AbstractType end
has_fields(AbstractType) # returns falsesourceEnergyModelsGUI.has_invested — Method
has_invested(data::ProcInvData)
has_invested(data::AbstractGUIObj)Returns a boolean indicator if investment has occured.
sourceEnergyModelsGUI.includes_area — Method
includes_area(case::Case)Check if the case includes elements from the EnergyModelsGeography package.
sourceEnergyModelsGUI.inherit_descriptive_names_from_supertypes! — Method
inherit_descriptive_names_from_supertypes!(descriptive_names, emx_supertypes_dict)Copies descriptive field names from supertypes to subtypes in the descriptive_names dictionary.
Arguments
descriptive_names::Dict: A dictionary containing descriptive names for structure fields,
organized by type.
emx_supertypes_dict::Dict: A dictionary mapping type identifiers to arrays of types,
where the first element is the type itself and the remaining elements are its supertypes.
Description
For each type in emx_supertypes_dict, this function checks if the type has fields. For each field, it looks for descriptive names in the supertypes. If a descriptive name exists for a field in a supertype but not in the subtype, it copies the descriptive name from the supertype to the subtype.
Modifies
- Updates
descriptive_namesin-place by inheriting missing descriptive names from supertypes.
EnergyModelsGUI.initialize_available_data! — Method
initialize_available_data!(gui)For all plotable objects, initialize the available data menu with items.
sourceEnergyModelsGUI.initialize_plot! — Method
initialize_plot!(gui::GUI, design::EnergySystemDesign)Initialize the plot of the topology of design object gui given an EnergySystemDesign design.
EnergyModelsGUI.installed — Method
EnergyModelsGUI.l2_norm — Method
EnergyModelsGUI.loaded — Method
EnergyModelsGUI.merge_dicts — Method
merge_dicts(dict1::Dict, dict2::Dict)Merge dict1 and dict2 (in case of overlap, dict2 overwrites entries in dict1).
EnergyModelsGUI.merge_svg_strings — Method
merge_svg_strings(svg1, svg2)Merge two SVG strings svg1 and svg2 into one with header from svg1.
EnergyModelsGUI.mouse_within_axis — Method
mouse_within_axis(ax::Makie.AbstractAxis, mouse_pos::Tuple{Float32,Float32})Check if mouse position is within the pixel area of ax.
EnergyModelsGUI.nested_eltype — Method
nested_eltype(x::TimeProfile)Return the type of the lowest TimeProfile, of a nested TimeProfile x, not being a FixedProfile.
EnergyModelsGUI.new_global_delta_h — Method
new_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 — Method
EnergyModelsGUI.parse_color — Method
parse_color(type::Type, color::Colorant)
parse_color(type::Type, color::Any)Parse color into the type type.
EnergyModelsGUI.pick_component! — Method
pick_component!(gui::GUI, ax_type::Symbol)
pick_component!(gui::GUI, plt::AbstractPlot, ax_type::Symbol)
pick_component!(gui::GUI, element::AbstractGUIObj, ::Symbol)
pick_component!(gui::GUI, element::Dict, ::Symbol)
pick_component!(gui::GUI, ::Nothing, ax_type::Symbol)Check if a system is found under the mouse pointer and if it is an AbstractGUIObj (for objects in the topology axis) or a Dict (for objects in the results axis). If found, state variables are updated. Results in the topology axis are only cleared if ax_type = :topo and in the results axis if ax_type = :results.
EnergyModelsGUI.pixel_to_data — Method
pixel_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 — Method
place_nodes_in_circle(total_nodes::Int64, current_node::Int64, r::Float32, xₒ::Float32, yₒ::Float32)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! — Method
plot_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! — Method
print_nested_structure!(
element,
output::Observable;
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.results_available — Method
results_available(model::Model)
results_available(model::String)Check if the model has a feasible solution.
sourceEnergyModelsGUI.save_design — Method
save_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 — Method
save_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 — Method
scroll_ylim(ax::Makie.AbstractAxis, val::Float64)Shift the ylim with val units to mimic scrolling feature of an axis ax.
EnergyModelsGUI.select_data! — Method
select_data!(gui::GUI, name::String)Select the data with name name from the available_data menu.
EnergyModelsGUI.square_intersection — Method
square_intersection(c::Point2f, θ::Float32, Δ::Float32)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 — Method
square_intersection(c::Point2f, x::Point2f, θ::Float32, Δ::Float32)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. If the line does not intersect the square, the extension of the two facing sides to x will be used instead.
EnergyModelsGUI.sub_system — Method
sub_system(system::SystemGeo, element::AbstractElement)Create a sub-system of system with the element as the reference node.
EnergyModelsGUI.toggle_selection_color! — Method
toggle_selection_color!(gui::GUI, selection::EnergySystemDesign, selected::Bool)
toggle_selection_color!(gui::GUI, selection::Connection, selected::Bool)
toggle_selection_color!(gui::GUI, selection::Dict{Symbol,Any}, selected::Bool)Set the color of selection to get_selection_color(gui) if selected, and its original color otherwise using the argument selected.
EnergyModelsGUI.transfer_model — Method
transfer_model(model::Model, system::AbstractSystem)
transfer_model(model::String, system::AbstractSystem)Convert the model to a DataFrame if it is provided as a path to a directory.
sourceEnergyModelsGUI.update! — Method
update!(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! — Method
update!(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! — Method
update!(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! — Method
EnergyModelsGUI.update_available_data_menu! — Method
update_available_data_menu!(gui::GUI, element)Update the get_menus(gui)[:available_data] with the available data of element.
EnergyModelsGUI.update_axis! — Method
update_axislabels!(gui::GUI, time_axis::Symbol)Update the xlabel, ylabel and ticks of the :results axis
sourceEnergyModelsGUI.update_barplot_dodge! — Method
update_barplot_dodge!(gui::GUI)Update the barplot of the state of the GUI (such that the bars are dodged away from each other).
sourceEnergyModelsGUI.update_descriptive_names! — Method
update_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! — Method
update_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! — Method
EnergyModelsGUI.update_legend! — Method
EnergyModelsGUI.update_limits! — Method
EnergyModelsGUI.update_limits! — Method
EnergyModelsGUI.update_plot! — Method
EnergyModelsGUI.update_plot! — Method
update_plot!(gui::GUI, element)Based on element update the results in get_axes(gui)[:results].
EnergyModelsGUI.update_plot! — Method
EnergyModelsGUI.update_plot! — Method
EnergyModelsGUI.update_sub_system_locations! — Method
update_sub_system_locations!(design::EnergySystemDesign, Δ::Point2f)Update the coordinates of a subsystem of design based on the movement of EnergySystemDesign design.
EnergyModelsGUI.update_title! — Method
EnergyModelsGUI.update_tree! — Method
update_tree!(current_lvl::Dict{Type, Union{Dict, Nothing}}, tmp_type::Type) -> NothingEnsures that a given type exists as a key in the current level of a nested type dependency dictionary.
Arguments
current_lvl::Dict{Type, Union{Dict, Nothing}}: The current level of the nested dictionary structure representing type dependencies.tmp_type::Type: The type to be added as a key in the current level if it does not already exist.
Behavior
If tmp_type is not already a key in current_lvl, it adds it with an empty dictionary as its value, preparing for further nesting.
Returns
Nothing: This function modifiescurrent_lvlin-place and does not return a value.