NREL-Sienna / SIIP-Tutorial

SIIP Tutorial for PowerSystems.jl, PowerSimuations.jl and PowerGraphics.jl
https://nrel-siip.github.io/SIIP-Tutorial/
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Method in Plots throwing error in How to interact with data in a PowerSystems.System struct #9

Open skyemoor opened 11 months ago

skyemoor commented 11 months ago

Up to the point of plotting the data, all exercises on this tutorial page executed as expected.

The issue arose when this code was executed;

using Plots
p = plot(popfirst!(data), label = popfirst!(names))
for (name, timeseries) in zip(names, data)
  plot!(p, timeseries, label = name)
end
p

The result was;

julia> using Plots

julia> p = plot(popfirst!(data), label = popfirst!(names)) ERROR: MethodError: no method matching popfirst!(::typeof(names)) Closest candidates are: popfirst!(::Base.InvasiveLinkedListSynchronized) at task.jl:686 popfirst!(::OrderedCollections.OrderedSet) at ~/.julia/packages/OrderedCollections/PRayh/src/ordered_set.jl:50 popfirst!(::DataStructures.CircularBuffer) at ~/.julia/packages/DataStructures/59MD0/src/circular_buffer.jl:99 ... Stacktrace: [1] top-level scope @ REPL[57]:1

julia> for (name, timeseries) in zip(names, data) plot!(p, timeseries, label = name) end ERROR: MethodError: no method matching iterate(::typeof(names)) Closest candidates are: iterate(::Union{LinRange, StepRangeLen}) at range.jl:872 iterate(::Union{LinRange, StepRangeLen}, ::Integer) at range.jl:872 iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at dict.jl:712 ... Stacktrace: [1] _zip_iterate_some @ ./iterators.jl:382 [inlined] [2] _zip_iterate_all @ ./iterators.jl:374 [inlined] [3] iterate(z::Base.Iterators.Zip{Tuple{typeof(names), Vector{TimeSeries.TimeArray{Float64, 1, Dates.DateTime, Vector{Float64}}}}}) @ Base.Iterators ./iterators.jl:364 [4] top-level scope @ ./REPL[58]:1

julia> p