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

Mistyped keyword argument gives very unhelpful error message #3209

Closed
felixcremer opened this issue Sep 4, 2023 · 2 comments
Closed

Mistyped keyword argument gives very unhelpful error message #3209

felixcremer opened this issue Sep 4, 2023 · 2 comments
Labels

Comments

@felixcremer
Copy link
Contributor

When I misspell a keyword argument I get a figure with an empty axis and the following unhelpful error message:
I would have expected to get an error message which tells me, that the keyword colormaps does not exist and that this is similar to the keyword colormap

julia> plot(rand(10,10), colormaps=:greys)
┌ Warning: Can't convert Observable{Symbol} to opengl, for attribute colormaps
└ @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLTypes.jl:432
Error showing value of type Makie.FigureAxisPlot:
ERROR: MethodError: no method matching gl_convert(::Symbol)

Closest candidates are:
  gl_convert(::T) where T<:GeometryBasics.Mesh
   @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLUniforms.jl:196
  gl_convert(::T) where T<:GeometryBasics.AbstractMesh
   @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLUniforms.jl:195
  gl_convert(::T) where T<:ColorTypes.Colorant
   @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLUniforms.jl:194
  ...

Stacktrace:
  [1] #map#13
    @ ~/.julia/packages/Observables/PHGQ8/src/Observables.jl:564 [inlined]
  [2] map
    @ ~/.julia/packages/Observables/PHGQ8/src/Observables.jl:562 [inlined]
  [3] const_lift
    @ ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLUtils.jl:106 [inlined]
  [4] gl_convert(s::Observable{Symbol})
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLUniforms.jl:228
  [5] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window, context::GLFW.Window)
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLTypes.jl:430
  [6] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window)
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/toRaR/src/GLAbstraction/GLTypes.jl:404
  [7] assemble_shader(data::Dict{Symbol, Any})
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/glshaders/visualize_interface.jl:108
  [8] draw_heatmap(screen::Any, data::Dict)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/glshaders/image_like.jl:52
  [9] (::GLMakie.var"#233#238"{GLMakie.Screen{GLFW.Window}, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}})(gl_attributes::Dict{Symbol, Any})
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/drawing_primitives.jl:455
 [10] (::GLMakie.var"#177#180"{GLMakie.var"#233#238"{GLMakie.Screen{GLFW.Window}, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}}, GLMakie.Screen{GLFW.Window}, Scene, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}})()
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/drawing_primitives.jl:135
 [11] get!(default::GLMakie.var"#177#180"{GLMakie.var"#233#238"{GLMakie.Screen{GLFW.Window}, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}}, GLMakie.Screen{GLFW.Window}, Scene, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}}, h::Dict{UInt64, GLMakie.GLAbstraction.RenderObject}, key::UInt64)
    @ Base ./dict.jl:468
 [12] cached_robj!(robj_func::GLMakie.var"#233#238"{GLMakie.Screen{GLFW.Window}, Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}}}, screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}})
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/drawing_primitives.jl:103
 [13] draw_atomic
    @ ~/.julia/packages/GLMakie/toRaR/src/drawing_primitives.jl:416 [inlined]
 [14] insert!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Heatmap{Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}})
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/drawing_primitives.jl:151
 [15] insertplots!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/screen.jl:447
 [16] insertplots!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene) (repeats 2 times)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/screen.jl:450
 [17] display_scene!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/screen.jl:379
 [18] GLMakie.Screen(scene::Scene, config::GLMakie.ScreenConfig; visible::Nothing, start_renderloop::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/screen.jl:396
 [19] GLMakie.Screen(scene::Scene, config::GLMakie.ScreenConfig)
    @ GLMakie ~/.julia/packages/GLMakie/toRaR/src/screen.jl:392
 [20] getscreen(::Module, ::Scene; screen_config::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/display.jl:408
 [21] getscreen
    @ ~/.julia/packages/Makie/Ylh0P/src/display.jl:391 [inlined]
 [22] display(figlike::Makie.FigureAxisPlot; backend::Module, inline::Bool, update::Bool, screen_config::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/display.jl:161
 [23] display(figlike::Makie.FigureAxisPlot)
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/display.jl:131
 [24] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [25] invokelatest
    @ ./essentials.jl:813 [inlined]
 [26] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:305
 [27] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:287
 [28] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:557
 [29] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:285
 [30] (::REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:899
 [31] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [32] invokelatest
    @ ./essentials.jl:813 [inlined]
 [33] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:2647
 [34] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL ~/.julia/juliaup/julia-1.9.2+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1300
 [35] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:514
  • [ x ] are you running newest version (version from docs) ?
(jl_iDP9Wt) pkg> st 
Status `/tmp/jl_iDP9Wt/Project.toml`
  [e9467ef8] GLMakie v0.8.8
  [ee78f7c6] Makie v0.19.8
  • [ x ] can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 PRO 5850U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1
@felixcremer felixcremer added the bug label Sep 4, 2023
@jkrumbiegel
Copy link
Member

Cf. #2966

@ffreyer
Copy link
Collaborator

ffreyer commented May 24, 2024

Fixed by #3626 in 0.21

@ffreyer ffreyer closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants