Skip to content

Sometimes units are not handled #3945

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

Open
3 tasks done
aplavin opened this issue Jun 7, 2024 · 4 comments
Open
3 tasks done

Sometimes units are not handled #3945

aplavin opened this issue Jun 7, 2024 · 4 comments
Labels
enhancement Feature requests and enhancements Makie Backend independent issues (Makie core) units aka dim converts

Comments

@aplavin
Copy link
Contributor

aplavin commented Jun 7, 2024

I encountered this strange inconsistency:

# works:
julia> scatter([1u"m"], [2])

# works:
julia> scatter([(1, 2)])

# doesn't work:
julia> scatter([(1u"m", 2)])
ERROR: ArgumentError:     Conversion failed for Scatter (With conversion trait PointBased()) with args: Tuple{Vector{Tuple{Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}, Int64}}} .
    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}}}.`

I guess it's an omission somewhere in the pipeline? The pipeline is quite involved, so not sure where exactly.

  • are you running newest version (version from docs) ?
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on?
@aplavin aplavin added the bug label Jun 7, 2024
@SimonDanisch
Copy link
Member

No, this is expected and discussed in the current limitation in the docs and Blogpost.
Its just much more complicated to handle those cases, and there wasn't much time to implement this feature already ;)

@ffreyer ffreyer added enhancement Feature requests and enhancements units aka dim converts Makie Backend independent issues (Makie core) and removed bug labels Aug 28, 2024
@bjarthur
Copy link
Contributor

bjarthur commented Apr 9, 2025

perhaps worth noting that the first "working" example does not work for DynamicQuantities.jl (but does for Unitful.jl):

julia> using DynamicQuantities, GLMakie

julia> scatter([1u"m"], [2])
ERROR: ArgumentError:     Conversion failed for Scatter (With conversion trait PointBased()) with args: Tuple{Vector{Quantity{Float64, Dimensions{FixedRational{Int32, 25200}}}}, Vector{Int64}} .
    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}}}.`

@aplavin
Copy link
Contributor Author

aplavin commented Apr 10, 2025

Makie only claims to support Unitful, so I implicitly assumed Unitful in this issue.
Probably, makes sense to handle any alternative unit packages separately?..

@icweaver
Copy link
Contributor

Yea, have some DQ support in the works here, but still early days. The scatter([1u"m"], [2]) example should work in that PR. Feedback welcome =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and enhancements Makie Backend independent issues (Makie core) units aka dim converts
Projects
None yet
Development

No branches or pull requests

5 participants