NREL-Sienna / PowerGraphics.jl

A package to generate visualizations from PowerSimulations.jl results. Part of the Scalable Integrated Infrastructure Planning Initiative at the National Renewable Energy Lab.

Home Page:https://www.nrel.gov/analysis/sienna.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plot_pgdata (and other functions) try to display multiple copies, even when display is false

kdayday opened this issue · comments

Some of the PG plot functions return multiple copies of the same graph, so I think there might be internal calls that still try to display the plot, even when display = false. This causes errors when working on Eagle, which doesn't support the plot display:

julia> plot_pgdata(generation; stack = true, display = false, save = simulation_folder)
ERROR: IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:
  [1] wait_connected(x::Sockets.TCPSocket)
    @ Sockets /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:532
  [2] connect
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:567 [inlined]
  [3] connect(addr::Sockets.IPv4, port::Int64)
    @ Sockets /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Sockets/src/Sockets.jl:553
  [4] try_connect(::Sockets.IPv4, ::Vararg{Any, N} where N; interval::Float64, attempts::Int64)
    @ Blink.AtomShell /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/process.jl:79
  [5] try_connect
    @ /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/process.jl:77 [inlined]
  [6] init(; debug::Bool)
    @ Blink.AtomShell /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/process.jl:93
  [7] #shell#9
    @ /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/process.jl:149 [inlined]
  [8] shell
    @ /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/process.jl:144 [inlined]
  [9] #Window#14
    @ /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/window.jl:89 [inlined]
 [10] Blink.AtomShell.Window(args::Dict{String, Int64})
    @ Blink.AtomShell /projects/summergo/.julia/packages/Blink/mwJC9/src/AtomShell/window.jl:89
 [11] display_blink(p::PlotlyJS.SyncPlot)
    @ PlotlyJS /projects/summergo/.julia/packages/PlotlyJS/WF333/src/display.jl:161
 [12] display(#unused#::PlotlyJS.PlotlyJSDisplay, p::PlotlyJS.SyncPlot)
    @ PlotlyJS /projects/summergo/.julia/packages/PlotlyJS/WF333/src/display.jl:155
 [13] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
 [14] _dataframe_plots_internal(plot::PlotlyBase.Plot{Vector{PlotlyBase.GenericTrace{Dict{Symbol, Any}}}, PlotlyBase.Layout{Dict{Symbol, Any}}, Vector{PlotlyBase.PlotlyFrame}}, variable::DataFrame, time_range::Vector{DateTime}, backend::Plots.PlotlyJSBackend; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:stack, :display, :save), Tuple{Bool, Bool, String}}})
    @ PowerGraphics /projects/summergo/.julia/packages/PowerGraphics/gjSgF/src/plotly_recipes.jl:101
 [15] plot_dataframe(p::PlotlyBase.Plot{Vector{PlotlyBase.GenericTrace{Dict{Symbol, Any}}}, PlotlyBase.Layout{Dict{Symbol, Any}}, Vector{PlotlyBase.PlotlyFrame}}, variable::DataFrame, time_range::StepRange{DateTime, Millisecond}; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:stack, :display, :save), Tuple{Bool, Bool, String}}})
    @ PowerGraphics /projects/summergo/.julia/packages/PowerGraphics/gjSgF/src/call_plots.jl:163
 [16] plot_pgdata(p::PlotlyBase.Plot{Vector{PlotlyBase.GenericTrace{Dict{Symbol, Any}}}, PlotlyBase.Layout{Dict{Symbol, Any}}, Vector{PlotlyBase.PlotlyFrame}}, pgdata::PowerGraphics.PGData; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:stack, :display, :save), Tuple{Bool, Bool, String}}})
    @ PowerGraphics /projects/summergo/.julia/packages/PowerGraphics/gjSgF/src/call_plots.jl:213
 [17] plot_pgdata(pgdata::PowerGraphics.PGData; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:stack, :display, :save), Tuple{Bool, Bool, String}}})
    @ PowerGraphics /projects/summergo/.julia/packages/PowerGraphics/gjSgF/src/call_plots.jl:202
 [18] top-level scope
    @ REPL[93]:1

@kdayday, what version of PlotlyJS.jl are you using?