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
conversion traits not taken into account in 0.21 #3847
Comments
Hmm, trying the most recent release – the underlying issue doesn't seem really fixed by that PR of mine... Example from the first post works, but actual plotting doesn't. julia> using AxisKeys, Makie
julia> Makie.convert_arguments(ct::PointBased, x::KeyedArray{<:Any,1}) = convert_arguments(ct, only(axiskeys(x)), AxisKeys.keyless_unname(x))
julia> scatter(KeyedArray([1,2,3], x=10:10:30))
# Makie 0.20: shows the plot
# Makie 0.21.2: throws
ERROR: ArgumentError: Conversion failed for Scatter (With conversion trait PointBased()) with args: Tuple{StepRange{Int64, Int64}, Vector{Point{2, Float64}}} .
Scatter requires to convert to argument types Tuple{AbstractVector{<:Union{Point2, Point3}}}, which convert_arguments didn't succeed in.
To fix this overload convert_arguments(P, args...) for Scatter or PointBased() and return an object of type Tuple{AbstractVector{<:Union{Point2, Point3}}}.`
Stacktrace:
[1] conversion_pipeline(P::Type{…}, used_attrs::Tuple{}, args::Tuple{…}, args_obs::Tuple{…}, user_attributes::Dict{…}, deregister::Vector{…}, recursion::Int64)
@ Makie ~/.julia/packages/Makie/We6MY/src/interfaces.jl:240
[2] conversion_pipeline(P::Type{…}, used_attrs::Tuple{}, args::Tuple{…}, args_obs::Tuple{…}, user_attributes::Dict{…}, deregister::Vector{…}, recursion::Int64)
@ Makie ~/.julia/packages/Makie/We6MY/src/interfaces.jl:233
[3] conversion_pipeline(P::Type{…}, used_attrs::Tuple{}, args::Tuple{…}, args_obs::Tuple{…}, user_attributes::Dict{…}, deregister::Vector{…})
@ Makie ~/.julia/packages/Makie/We6MY/src/interfaces.jl:213
[4] (Scatter)(user_args::Tuple{KeyedArray{Int64, 1, NamedDimsArray{…}, Base.RefValue{…}}}, user_attributes::Dict{Symbol, Any})
@ Makie ~/.julia/packages/Makie/We6MY/src/interfaces.jl:271
[5] _create_plot(F::Function, attributes::Dict{Symbol, Any}, args::KeyedArray{Int64, 1, NamedDimsArray{…}, Base.RefValue{…}})
@ Makie ~/.julia/packages/Makie/We6MY/src/figureplotting.jl:316
[6] #scatter#72
@ ~/.julia/packages/MakieCore/8S3xT/src/recipes.jl:436 [inlined]
[7] scatter(args::KeyedArray{Int64, 1, NamedDimsArray{(:x,), Int64, 1, Vector{Int64}}, Base.RefValue{StepRange{Int64, Int64}}})
@ MakieCore ~/.julia/packages/MakieCore/8S3xT/src/recipes.jl:434
[8] top-level scope
@ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types. Any ideas on how to actually fix it? |
This time I don't even see a way to work around this issue... Any advice welcome! |
Defining My guess is that KeyedArrays are hitting |
Thanks for the suggestion, will try that! |
It's a separate step to divide a user defined type into it's x and y components |
In 0.21,
convert_argument(trait, args...)
methods are not really called with user-specified arguments.That's due to the new
expand_dimensions
function called beforeconvert_arguments
with conversion trait:Makie.jl/src/conversions.jl
Lines 17 to 21 in d157f9c
Noticed when trying to update KeyedArray conversions (in AxisKeysExtra.jl) to the new Makie version, specifically conversions like https://github.com/JuliaAPlavin/AxisKeysExtra.jl/blob/0000000065d69673f7f40c0f93f01ba0fbbbda34/ext/MakieExt.jl#L10-L13. MWE:
]activate --temp; add Makie
)The text was updated successfully, but these errors were encountered: