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

conversion traits not taken into account in 0.21 #3847

Closed
3 tasks done
aplavin opened this issue May 9, 2024 · 0 comments · Fixed by #3859
Closed
3 tasks done

conversion traits not taken into account in 0.21 #3847

aplavin opened this issue May 9, 2024 · 0 comments · Fixed by #3859
Labels

Comments

@aplavin
Copy link
Contributor

aplavin commented May 9, 2024

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 before convert_arguments with conversion trait:

CT = conversion_trait(T, args...)
# Try to expand dimensions first, as this is the most basic step!
expanded = expand_dimensions(CT, args...)
!isnothing(expanded) && return convert_arguments(T, expanded...; kw...)
.

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:

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> convert_arguments(Scatter, KeyedArray([1,2,3], x=10:10:30))
# 0.20, expected:
(Point{2, Float32}[[10.0, 1.0], [20.0, 2.0], [30.0, 3.0]],)
# 0.21, unexpected:
(10:10:30, Point{2, Float64}[[1.0, 1.0], [2.0, 2.0], [3.0, 3.0]])
  • are you running newest version (version from docs) ? bug only appears in 0.21, while 0.20 works fine
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on? any platform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant