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

CI build failure with latest versions #1358

Closed
t-bltg opened this issue Jul 4, 2021 · 5 comments · Fixed by #1359 or JuliaPlots/Plots.jl#3611
Closed

CI build failure with latest versions #1358

t-bltg opened this issue Jul 4, 2021 · 5 comments · Fixed by #1359 or JuliaPlots/Plots.jl#3611

Comments

@t-bltg
Copy link

t-bltg commented Jul 4, 2021

Recent version (changes between v0.25.6 which was OK and v0.25.8 continuously fail our CI at https://github.com/JuliaPlots/Plots.jl.

We hit a failure here: https://github.com/JuliaPlots/StatsPlots.jl/blob/fadcdf7f2d9c91798b9a789b68835fa7896a2183/test/runtests.jl#L75

Reproducer

using Plots; gr()
using StatsPlots
using Distributions

main() = begin
  plot(Poisson(1))
  png("bug")
end

main()

Output

ERROR: LoadError: MethodError: no method matching UnitRange(::Int64, ::Float64)
Closest candidates are:
  UnitRange(::T, ::T) where T<:Real at range.jl:289
Stacktrace:
  [1] yz_args(dist::Poisson{Float64})
    @ StatsPlots [...]/StatsPlots/yDVtk/src/distributions.jl:22
  [2] macro expansion
    @ [...]/StatsPlots/yDVtk/src/distributions.jl:31 [inlined]
  [3] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, dist::Distribution)
    @ StatsPlots [...]/RecipesBase/92zOw/src/RecipesBase.jl:282
  [4] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline [...]/RecipesPipeline/a80Nu/src/user_recipe.jl:36
  [5] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline [...]/RecipesPipeline/a80Nu/src/RecipesPipeline.jl:70
  [6] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots [...]/Plots/Bfn5f/src/plot.jl:204
  [7] plot(args::Any; kw::Any)
    @ Plots [...]/Plots/Bfn5f/src/plot.jl:89
  [8] plot
    @ [...]/Plots/Bfn5f/src/plot.jl:83 [inlined]
  [9] main()
    @ Main [...]/bug.jl:6
 [10] top-level scope
    @ [...]/bug.jl:10
in expression starting at [...]/bug.jl:10
@devmotion
Copy link
Member

It seems changing https://github.com/JuliaPlots/StatsPlots.jl/blob/fadcdf7f2d9c91798b9a789b68835fa7896a2183/src/distributions.jl#L22 (which is a heuristic that will be incorrect for any discrete distribution whose support are not unitranges of integers) to

        lower, upper = default_range(dist)
        return (UnitRange(Int(lower), Int(upper)),)

should fix the issue.

@t-bltg
Copy link
Author

t-bltg commented Jul 4, 2021

Thanks for the quick reply, I will open a PR there.

@devmotion
Copy link
Member

I also figured out which change in Distributions provoked the issue, I'll open a PR to fix it in Distributions. Probably it would still be helpful to ensure in StatsPlots that the arguments of UnitRange are integers.

@t-bltg
Copy link
Author

t-bltg commented Jul 4, 2021

I also figured out which change in Distributions provoked the issue, I'll open a PR to fix it in Distributions. Probably it would still be helpful to ensure in StatsPlots that the arguments of UnitRange are integers.

If you want to open the PR in StatsPlots please do, I'm absolutely not familiar with StatsPlots ...

In the mean time I will try to see how we can bypass the issue in our workflow since the whole CI is down because of this 🙄

@t-bltg
Copy link
Author

t-bltg commented Jul 5, 2021

@devmotion, it's fixed from our side with JuliaPlots/StatsPlots.jl#454.

I'd like to thank you for the reactivity, it was very much appreciated 😉

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

Successfully merging a pull request may close this issue.

2 participants