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

WGLMakie + IJulia is hiding error messages #3182

Closed
3 tasks done
kbarros opened this issue Aug 26, 2023 · 1 comment
Closed
3 tasks done

WGLMakie + IJulia is hiding error messages #3182

kbarros opened this issue Aug 26, 2023 · 1 comment
Labels
bug dependencies Related to a package used by Makie Errors & Warnings Missing/Bad errors Integration with other packages WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.

Comments

@kbarros
Copy link
Contributor

kbarros commented Aug 26, 2023

Executing the following code from an IJulia notebook fails to show any output (no error, no figure):

using WGLMakie

x = [0.4889336388444519, 0.4889336388444523, 0.4889336388444518, 0.4889336388444521, 0.48893363884445185, 0.48893363884445157, 0.4889336388444523, 0.4889336388444521, 0.48893363884445196, 0.4889336388444522, 0.4889336388444519, 0.48893363884445207, 0.48893363884445196]
y = [0.004971176341112207, 0.004971176341112213, 0.004971176341112226, 0.004971176341112301, 0.004971176341112295, 0.0049711763411122165, 0.004971176341112212, 0.004971176341112203, 0.004971176341112215, 0.004971176341112368, 0.004971176341112369, 0.0049711763411122165, 0.004971176341112197]

fig = Figure(resolution=(1024,768))
ax = Axis(fig[1,1])
lines!(ax, 1:13, x; color=y)
fig
image

I was expecting to see an error explaining that the data is problematic. In contrast, executing the same code from VSCode will correctly report an error:

Display Error: ERROR: Can't interpolate in a range where cmin == cmax. This can happen, for example, if a colorrange is set automatically but there's only one unique value present.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] interpolated_getindex
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/colorsampler.jl:36 [inlined]
  [3] #74
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/colorsampler.jl:172 [inlined]
  [4] iterate
    @ Base ./generator.jl:47 [inlined]
  [5] _collect(c::Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}, itr::Base.Generator{Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}, Makie.var"#74#75"{Vector{ColorTypes.RGBA{Float32}}, typeof(identity), MakieCore.Automatic, MakieCore.Automatic, ColorTypes.RGBA{Float32}, Float32, Float32}}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:852
  [6] collect_similar(cont::Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}, itr::Base.Generator{Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}, Makie.var"#74#75"{Vector{ColorTypes.RGBA{Float32}}, typeof(identity), MakieCore.Automatic, MakieCore.Automatic, ColorTypes.RGBA{Float32}, Float32, Float32}})
    @ Base ./array.jl:761
  [7] map(f::Function, A::Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false})
    @ Base ./abstractarray.jl:3273
  [8] numbers_to_colors(numbers::Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}, colormap::Vector{ColorTypes.RGBA{Float32}}, colorscale::Function, colorrange::Vec{2, Float32}, lowclip::MakieCore.Automatic, highclip::MakieCore.Automatic, nan_color::ColorTypes.RGBA{Float32})
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/colorsampler.jl:163
  [9] map(::typeof(Makie.numbers_to_colors), ::Observable{Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}}, ::Observable{Vector{ColorTypes.RGBA{Float32}}}, ::Vararg{Any}; ignore_equal_values::Bool)
    @ Observables ~/.julia/packages/Observables/PHGQ8/src/Observables.jl:564
 [10] map(::typeof(Makie.numbers_to_colors), ::Observable{Base.ReinterpretArray{Float32, 1, Tuple{Float32, Float32}, GeometryBasics.TupleView{Tuple{Float32, Float32}, 2, 1, Vector{Float32}}, false}}, ::Observable{Vector{ColorTypes.RGBA{Float32}}}, ::Function, ::Vararg{Any})
    @ Observables ~/.julia/packages/Observables/PHGQ8/src/Observables.jl:562
 [11] create_shader(scene::Scene, plot::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/lines.jl:56
 [12] serialize_three(scene::Scene, plot::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:320
 [13] serialize_plots(scene::Scene, plots::Vector{AbstractPlot}, result::Vector{Any})
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:309
 [14] serialize_plots(scene::Scene, plots::Vector{AbstractPlot}, result::Vector{Any})
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:306 [inlined]
 [15] serialize_scene(scene::Scene)
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:293
 [16] (::WGLMakie.var"#52#57")(child::Scene)
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:291
 [17] iterate(::Base.Generator{Vector{Scene}, WGLMakie.var"#52#57"})
    @ Base ./generator.jl:47
 [18] _collect(c::Vector{Scene}, itr::Base.Generator{Vector{Scene}, WGLMakie.var"#52#57"}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:852
 [19] collect_similar(cont::Vector{Scene}, itr::Base.Generator{Vector{Scene}, WGLMakie.var"#52#57"})
    @ Base ./array.jl:761
 [20] map(f::Function, A::Vector{Scene})
    @ Base ./abstractarray.jl:3273
 [21] serialize_scene(scene::Scene)
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/serialization.jl:291
--- the last 6 lines are repeated 1 more time ---
 [28] three_display(session::JSServe.Session{JSServe.WebSocketConnection}, scene::Scene; screen_config::@Kwargs{})
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/three_plot.jl:43
 [29] three_display
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/three_plot.jl:41 [inlined]
 [30] #15
    @ WGLMakie ~/.julia/packages/WGLMakie/B9DvR/src/display.jl:98 [inlined]
 [31] (::JSServe.var"#8#14"{WGLMakie.var"#15#17"{WGLMakie.Screen, Scene}})(session::JSServe.Session{JSServe.WebSocketConnection}, request::HTTP.Messages.Request)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/types.jl:261
 [32] #invokelatest#2
    @ JSServe ./essentials.jl:887 [inlined]
 [33] invokelatest
    @ JSServe ./essentials.jl:884 [inlined]
 [34] rendered_dom(session::JSServe.Session{JSServe.WebSocketConnection}, app::JSServe.App, target::HTTP.Messages.Request)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/app.jl:40
 [35] rendered_dom(session::JSServe.Session, app::JSServe.App, target::Any)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/app.jl:38 [inlined]
 [36] session_dom(session::JSServe.Session{JSServe.WebSocketConnection}, app::JSServe.App; init::Bool, html_document::Bool)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/session.jl:272
 [37] session_dom(session::JSServe.Session{JSServe.WebSocketConnection}, app::JSServe.App)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/session.jl:271
 [38] show(io::IOContext{IOBuffer}, m::MIME{Symbol("text/html")}, app::JSServe.App)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/display.jl:79
 [39] show(io::IOContext{IOBuffer}, m::MIME{Symbol("text/html")}, app::JSServe.App)
    @ JSServe ~/.julia/packages/JSServe/qgqel/src/display.jl:113 [inlined]
 [40] backend_show
    @ Makie ~/.julia/packages/WGLMakie/B9DvR/src/display.jl:107 [inlined]
 [41] show(io::IOBuffer, m::MIME{Symbol("juliavscode/html")}, figlike::Figure)
    @ Makie ~/.julia/packages/Makie/Ylh0P/src/display.jl:248
 [42] __binrepr(m::MIME{Symbol("juliavscode/html")}, x::Figure, context::Nothing)
    @ Base.Multimedia ./multimedia.jl:171
 [43] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("juliavscode/html")}, x::Figure)
    @ VSCodeServer ./array.jl:0
 [44] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
    @ Base.Multimedia ./multimedia.jl:228
 [45] display(d::VSCodeServer.InlineDisplay, x::Figure)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/display.jl:166
 [46] #invokelatest#2
    @ VSCodeServer ./essentials.jl:887 [inlined]
 [47] invokelatest
    @ VSCodeServer ./essentials.jl:884 [inlined]
 [48] (::VSCodeServer.var"#66#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/eval.jl:207
 [49] withpath(f::VSCodeServer.var"#66#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/repl.jl:249
 [50] (::VSCodeServer.var"#65#69"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/eval.jl:155
 [51] hideprompt(f::VSCodeServer.var"#65#69"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/repl.jl:38
 [52] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/eval.jl:126
 [53] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:515
 [54] with_logger
    @ VSCodeServer ./logging.jl:627 [inlined]
 [55] (::VSCodeServer.var"#63#67"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.48.1/scripts/packages/VSCodeServer/src/eval.jl:225
 [56] #invokelatest#2
    @ Base ./essentials.jl:887 [inlined]
 [57] invokelatest(::Any)
    @ Base ./essentials.jl:884
  • are you running newest version (version from docs) ?
WGLMakie v0.8.12
IJulia v1.24.2
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie; add IJulia)
  • What platform + GPU are you on?

Julia Version 1.10.0-beta2
Commit a468aa198d0 (2023-08-17 06:27 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 2 on 6 virtual cores

@kbarros kbarros added the bug label Aug 26, 2023
@ffreyer ffreyer added WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie. dependencies Related to a package used by Makie Errors & Warnings Missing/Bad errors Integration with other packages labels Aug 26, 2024
@SimonDanisch
Copy link
Member

This was fixed by #3681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Related to a package used by Makie Errors & Warnings Missing/Bad errors Integration with other packages WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.
Projects
None yet
Development

No branches or pull requests

3 participants