-
Notifications
You must be signed in to change notification settings - Fork 46
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
AlgebraOfGraphics.density() error message: "LoadError: Tuple field type cannot be Union{}." in Julia 1.10 #472
Comments
I'm thinking this issue is caused by this change to Julia in 1.10: A new more-specific rule for methods resolves ambiguities containing Union{} in favor of the method defined explicitly to handle the Union{} argument. This makes it possible to define methods to explicitly handle Union{} without the ambiguities that commonly would result previously. This also lets the runtime optimize certain method lookups in a way that significantly improves load and inference times for heavily overloaded methods that dispatch on Types (such as traits and constructors). Possibly the error is happening here?:
|
I'm encountering this too with this simpler reproducer: julia> draw(
data((x=randn(100), y=randn(100))) *
mapping(:x, :y) *
AlgebraOfGraphics.density() *
visual(Contour)
)
ERROR: Tuple field type cannot be Union{}
Stacktrace:
[1] map(f::Function, d::Dictionaries.Indices{Union{}})
@ Dictionaries ~/.julia/packages/Dictionaries/7aBxp/src/map.jl:91
[2] unnest(vs::Vector{@NamedTuple{}}, indices::Dictionaries.Indices{Union{}})
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layer.jl:81
[3] unnest_dictionaries(vs::Vector{@NamedTuple{}})
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layer.jl:84
[4] map(f::AlgebraOfGraphics.var"#193#194"{@NamedTuple{…}}, processedlayer::ProcessedLayer)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layer.jl:101
[5] (::AlgebraOfGraphics.DensityAnalysis{…})(input::ProcessedLayer)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/transformations/density.jl:30
[6] call_composed
@ Base ./operators.jl:1045 [inlined]
[7] call_composed
@ Base ./operators.jl:1044 [inlined]
[8] (::ComposedFunction{AlgebraOfGraphics.Visual, AlgebraOfGraphics.DensityAnalysis{…}})(x::ProcessedLayer)
@ Base ./operators.jl:1041
[9] process(layer::Layer)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/processing.jl:102
[10] iterate(g::Base.Generator, s::Vararg{Any})
@ Base ./generator.jl:47 [inlined]
[11] collect(itr::Base.Generator{Layers, typeof(AlgebraOfGraphics.process)})
@ Base ./array.jl:834
[12] map
@ ./abstractarray.jl:3310 [inlined]
[13] ProcessedLayers(a::Layer)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layers.jl:41
[14] compute_axes_grid(d::Layer; axis::@NamedTuple{}, palettes::@NamedTuple{})
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layers.jl:114
[15] compute_axes_grid
@ ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layers.jl:110 [inlined]
[16] compute_axes_grid(fig::Figure, d::Layer; axis::@NamedTuple{}, palettes::@NamedTuple{})
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layers.jl:100
[17] compute_axes_grid
@ ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/algebra/layers.jl:97 [inlined]
[18] #241
@ ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:21 [inlined]
[19] update
@ ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:10 [inlined]
[20] plot!(fig::Figure, d::Layer; axis::@NamedTuple{}, palettes::@NamedTuple{})
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:21
[21] plot!
@ ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:16 [inlined]
[22] (::AlgebraOfGraphics.var"#245#246"{…})(f::Figure)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:48
[23] update
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:10 [inlined]
[24] #draw#244
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:47 [inlined]
[25] draw(d::Layer)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/tbMEb/src/draw.jl:44
[26] top-level scope
@ REPL[7]:1
Some type information was truncated. Use `show(err)` to see complete types. |
@sethaxen and @rdboyes you see that latest comment that this is likely an issue with the |
I saw it! I meant to post an issue on Dictionaries but I haven't gotten around to it yet |
I've got a PR to Dictionaries with a fix: andyferris/Dictionaries.jl#127 |
well, this is unfortunate, now AoG is really failing with a lot of my examples :( due to this . |
Bug description
Tutorial code generates a LoadError: Tuple field type cannot be Union{}.
Steps to reproduce
Error reporting
Version info
The text was updated successfully, but these errors were encountered: