Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"reducing over an empty collection" error in dotplot #527

Open
yha opened this issue Feb 19, 2023 · 0 comments
Open

"reducing over an empty collection" error in dotplot #527

yha opened this issue Feb 19, 2023 · 0 comments

Comments

@yha
Copy link
Member

yha commented Feb 19, 2023

Inputs with small variance sometimes make dotplot error:

x = ones(7)
x[2] -= 1e-16
dotplot(x)
Stacktrace:
  [1] _empty_reduce_error()
    @ Base .\reduce.jl:301
  [2] mapreduce_empty(f::Function, op::Base.BottomRF{typeof(Base._rf_findmin)}, T::Type)
    @ Base .\reduce.jl:344
  [3] reduce_empty(op::Base.MappingRF{Base.var"#262#263"{typeof(identity)}, Base.BottomRF{typeof(Base._rf_findmin)}}, #unused#::Type{Pair{Int64, Float64}})
    @ Base .\reduce.jl:331
  [4] reduce_empty_iter
    @ .\reduce.jl:357 [inlined]
  [5] reduce_empty_iter
    @ .\reduce.jl:356 [inlined]
  [6] foldl_impl
    @ .\reduce.jl:49 [inlined]
  [7] mapfoldl_impl
    @ .\reduce.jl:44 [inlined]
  [8] #mapfoldl#244
    @ .\reduce.jl:162 [inlined]
  [9] mapfoldl
    @ .\reduce.jl:162 [inlined]
 [10] findmin
    @ .\reduce.jl:862 [inlined]
 [11] _findmin
    @ .\reduce.jl:888 [inlined]
 [12] #findmin#783
    @ .\reducedim.jl:1005 [inlined]
 [13] findmin
    @ .\reducedim.jl:1005 [inlined]
 [14] |>
    @ .\operators.jl:966 [inlined]
 [15] _broadcast_getindex_evalf
    @ .\broadcast.jl:670 [inlined]
 [16] _broadcast_getindex
    @ .\broadcast.jl:643 [inlined]
 [17] _getindex
    @ .\broadcast.jl:666 [inlined]
 [18] _broadcast_getindex
    @ .\broadcast.jl:642 [inlined]
 [19] getindex
    @ .\broadcast.jl:597 [inlined]
 [20] macro expansion
    @ .\broadcast.jl:961 [inlined]
 [21] macro expansion
    @ .\simdloop.jl:77 [inlined]
 [22] copyto!
    @ .\broadcast.jl:960 [inlined]
 [23] copyto!
    @ .\broadcast.jl:913 [inlined]
 [24] copy
    @ .\broadcast.jl:885 [inlined]
 [25] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(|>), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(|>), Tuple{Vector{Vector{Float64}}, Base.RefValue{typeof(findmin)}}}, Base.RefValue{typeof(first)}}})
    @ Base.Broadcast .\broadcast.jl:860
 [26] (::StatsPlots.var"#getlocalwidths#193")(widths::Vector{Float64}, centers::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, y::Vector{Float64})
    @ StatsPlots c:\Users\sternlab\.julia\dev\StatsPlots\src\dotplot.jl:54
 [27] violinoffsets(maxwidth::Float64, y::Vector{Float64})
    @ StatsPlots c:\Users\sternlab\.julia\dev\StatsPlots\src\dotplot.jl:71
 [28] (::StatsPlots.var"#getoffsets#83"{Symbol})(halfwidth::Float64, y::Vector{Float64})
    @ StatsPlots c:\Users\sternlab\.julia\dev\StatsPlots\src\dotplot.jl:19
 [29] macro expansion
    @ c:\Users\sternlab\.julia\dev\StatsPlots\src\dotplot.jl:32 [inlined]
 [30] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, #unused#::Type{Val{:dotplot}}, x::Any, y::Any, z::Any)
    @ StatsPlots C:\Users\sternlab\.julia\packages\RecipesBase\z10lo\src\RecipesBase.jl:300
 [31] _process_seriesrecipe(plt::Any, plotattributes::Any)
    @ RecipesPipeline C:\Users\sternlab\.julia\packages\RecipesPipeline\XxUHt\src\series_recipe.jl:50
 [32] _process_seriesrecipes!(plt::Any, kw_list::Any)
    @ RecipesPipeline C:\Users\sternlab\.julia\packages\RecipesPipeline\XxUHt\src\series_recipe.jl:27
 [33] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\sternlab\.julia\packages\RecipesPipeline\XxUHt\src\RecipesPipeline.jl:99
 [34] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots C:\Users\sternlab\.julia\packages\Plots\io9zQ\src\plot.jl:223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant