PowerGraphics.categorize_data
— MethodRe-categorizes data according to an aggregation dictionary
- makes no guarantee of complete data collection *
Example
aggregation = PG.make_fuel_dictionary(results_uc.system)
PG.categorize_data(gen_uc.data, aggregation)
PowerGraphics.combine_categories
— Methodaggregates and combines data into single DataFrame
Example
PG.combine_categories(gen_uc.data)
PowerGraphics.get_generator_category
— MethodReturn the generator category for this fuel and unit_type.
PowerGraphics.get_generator_mapping
— FunctionReturn a dict where keys are a tuple of input parameters (fuel, unit_type) and values are generator types.
PowerGraphics.make_fuel_dictionary
— Methodgenerators = make_fuel_dictionary(system::PSY.System, mapping::Dict{NamedTuple, String})
This function makes a dictionary of fuel type and the generators associated.
Arguments
sys::PSY.System
: the system that is used to create the resultsresults::IS.Results
: results
Key Words
categories::Dict{String, NamedTuple}
: if stacking by a different category is desired
Example
results = solveopmodel!(OpModel) generators = makefueldictionary(sys)
PowerGraphics.plot_dataframe
— Methodplot_dataframe(df, time_range)
plot_dataframe(plot, variable, time_range)
This function makes a plot of a specific dataframe and time range, not necessarily from the results
Arguments
df::DataFrames.DataFrame
: The dataframe to be plottedtime_range::Union{Array, DataFrame}
: The time range to be plotted
Example
var_name = :P__ThermalStandard
df = PSI.read_realized_variables(results, names = [var_name])[var_name]
time_range = PSI.get_realized_timestamps(results)
plot = plot_dataframe(df, time_range)
Accepted Key Words
display::Bool
: set to false to prevent the plots from displayingsave::String = "file_path"
: set a file path to save the plotsformat::String = "png"
: set a different format for saving a PlotlyJS plotseriescolor::Array
: Set different colors for the plotstitle::String = "Title"
: Set a title for the plotscurtailment::Bool
: plot the curtailment with the variablestack::Bool
: stack plot tracesbar::Bool
: create bar plotnofill::Bool
: force empty area fill
PowerGraphics.plot_pgdata
— Methodplot_pgdata(pgdata, time_range)
plot_pgdata(plot, pgdata, time_range)
This function makes a plot of a PGdata object
Arguments
plot
: existing plot handle (optional)pgdata::PGData
: The dataframe to be plotted
Example
var_name = :P__ThermalStandard
df = PSI.read_realized_variables(results, names = [var_name])[var_name]
time_range = PSI.get_realized_timestamps(results)
plot = plot_dataframe(df, time_range)
Accepted Key Words
combine_categories::Bool = false
: plot category values or each value in a categorydisplay::Bool
: set to false to prevent the plots from displayingsave::String = "file_path"
: set a file path to save the plotsformat::String = "png"
: set a different format for saving a PlotlyJS plotseriescolor::Array
: Set different colors for the plotstitle::String = "Title"
: Set a title for the plotscurtailment::Bool
: plot the curtailment with the variablestack::Bool
: stack plot tracesbar::Bool
: create bar plotnofill::Bool
: force empty area fill
PowerGraphics.report
— Methodreport(res::IS.Results, out_path::String, design_template::String)
This function uses weave to either generate a LaTeX or HTML file based on the reportdesign.jmd (julia markdown) file that it reads. Outpath in the weave function dictates where the created file gets exported.
Arguments
results::IS.Results
: The results to be plottedout_path::String
: folder path to the location the report should be generateddesign_template::String = "file_path"
: directs the function to the julia markdown report design, the default
Example
results = solve_op_problem!(OpModel)
out_path = "/Users/downloads"
report(results, out_path, template)
Accepted Key Words
doctype::String = "md2html"
: create an HTML, default is PDF via latexbackend::Plots.backend() = plotlyjs()
: sets the plots backend, default is gr()
PowerGraphics.save_plot
— Methodsave_plot(plot, filename)
Saves plot to specified filename
Arguments
plot
: plot objectfilename::String
: save to filename
Example
res = solve_op_problem!(OpProblem)
plot = plot_fuel(res)
save_plot(plot, "my_plot.png")
Accepted Key Words (currently only implemented for PlotlyJS backend)
format::String = "png"
: set a different format ["html"] for saving a PlotlyJS plotjs::Symbol = :embed,
: options are [:embed, :local, :remote] see PlotlyJS.jl docs...width::Union{Nothing,Int}=nothing
height::Union{Nothing,Int}=nothing
scale::Union{Nothing,Real}=nothing