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

MethodError in concrete rectification plot #2644

Closed
mforets opened this issue Apr 5, 2021 · 1 comment · Fixed by #2650
Closed

MethodError in concrete rectification plot #2644

mforets opened this issue Apr 5, 2021 · 1 comment · Fixed by #2650
Assignees

Comments

@mforets
Copy link
Member

mforets commented Apr 5, 2021

If we use the definition in #2643, then:

using Random

Random.seed!(11)

P = rand(HPolygon)
R = rectify(P)

plot(P)
plot!(R, 1e-2)

MethodError: no method matching low(::∅)
Closest candidates are:
  low(::AbstractSingleton) at /home/mforets/.julia/dev/LazySets/src/Interfaces/AbstractSingleton.jl:120
  low(::AbstractSingleton, ::Int64) at /home/mforets/.julia/dev/LazySets/src/Interfaces/AbstractSingleton.jl:139
  low(::Interval{N, IN} where IN<:IntervalArithmetic.AbstractInterval{N}) where N at /home/mforets/.julia/dev/LazySets/src/Sets/Interval.jl:298
  ...

Stacktrace:
  [1] _update_plot_limits!(lims::Dict{Any, Any}, X::LinearMap{Float64, Intersection{Float64, HPolygon{Float64, Vector{Float64}}, HPolyhedron{Float64, LazySets.Arrays.SingleEntryVector{Float64}}}, Float64, Diagonal{Float64, Vector{Float64}}})
    @ LazySets ~/.julia/dev/LazySets/src/Plotting/plot_recipes.jl:48
  [2] macro expansion
    @ ~/.julia/dev/LazySets/src/Plotting/plot_recipes.jl:321 [inlined]
  [3] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, X::LinearMap{Float64, Intersection{Float64, HPolygon{Float64, Vector{Float64}}, HPolyhedron{Float64, LazySets.Arrays.SingleEntryVector{Float64}}}, Float64, Diagonal{Float64, Vector{Float64}}}, ε::Float64)
    @ LazySets ~/.julia/packages/RecipesBase/92zOw/src/RecipesBase.jl:282
  [4] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/CirY4/src/user_recipe.jl:36
  [5] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/CirY4/src/RecipesPipeline.jl:70
  [6] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots ~/.julia/packages/Plots/SVksJ/src/plot.jl:172
  [7] plot!(::Plots.Plot, ::Any, ::Vararg{Any, N} where N; kw::Any)
    @ Plots ~/.julia/packages/Plots/SVksJ/src/plot.jl:162
  [8] plot!(::Plots.Plot, ::Any, ::Vararg{Any, N} where N)
    @ Plots ~/.julia/packages/Plots/SVksJ/src/plot.jl:159
  [9] plot!(::Any, ::Vararg{Any, N} where N; kw::Any)
    @ Plots ~/.julia/packages/Plots/SVksJ/src/plot.jl:153
 [10] plot!(::Any, ::Any)
    @ Plots ~/.julia/packages/Plots/SVksJ/src/plot.jl:147
 [11] top-level scope
    @ In[57]:9
 [12] eval
    @ ./boot.jl:360 [inlined]
 [13] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1094
@mforets
Copy link
Member Author

mforets commented Apr 5, 2021

This can be solved by adding an emptiness check: isempty(box) && return nothing,

@schillic schillic self-assigned this Apr 6, 2021
schillic added a commit that referenced this issue Apr 8, 2021
#2644 - Fix _update_plot_limits! for empty inputs
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