PowerGraphics.categorize_dataMethod

Re-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.make_fuel_dictionaryMethod
generators = 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 results
  • results::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_dataframeMethod
plot_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 plotted
  • time_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 displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • curtailment::Bool: plot the curtailment with the variable
  • stack::Bool: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
PowerGraphics.plot_pgdataMethod
plot_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 category
  • display::Bool: set to false to prevent the plots from displaying
  • save::String = "file_path": set a file path to save the plots
  • format::String = "png": set a different format for saving a PlotlyJS plot
  • seriescolor::Array: Set different colors for the plots
  • title::String = "Title": Set a title for the plots
  • curtailment::Bool: plot the curtailment with the variable
  • stack::Bool: stack plot traces
  • bar::Bool : create bar plot
  • nofill::Bool : force empty area fill
PowerGraphics.reportMethod
report(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 plotted
  • out_path::String: folder path to the location the report should be generated
  • design_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 latex
  • backend::Plots.backend() = plotlyjs(): sets the plots backend, default is gr()
PowerGraphics.save_plotMethod
save_plot(plot, filename)

Saves plot to specified filename

Arguments

  • plot: plot object
  • filename::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 plot
  • js::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