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

Plotting with AoG: MethodError: no method matching select(::AlgebraOfGraphics.Columns{DimTable}, ::Type{X}) #831

Closed
RomeoV opened this issue Nov 1, 2024 · 3 comments

Comments

@RomeoV
Copy link

RomeoV commented Nov 1, 2024

I'm running the first example for plotting with AlgebraOfGraphics (AoG). However, it throws an error.

import Pkg; Pkg.add(["CairoMakie", "AlgebraOfGraphics", "DimensionalData"])
using CairoMakie, AlgebraOfGraphics, DimensionalData


A = DimArray(rand(10, 10), (X(1:10), Y(1:10)), name = :data)

data(A) * mapping(X, Y; color = :data) * visual(Scatter) |> draw

yields

julia> data(A) * mapping(X, Y; color = :data) * visual(Scatter) |> draw
ERROR: MethodError: no method matching select(::AlgebraOfGraphics.Columns{DimTable}, ::Type{X})
The function `select` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  select(::Nothing, ::Any, ::Any)
   @ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/BPWA1/src/algebra/select.jl:25
  select(::AlgebraOfGraphics.Columns, ::Union{AbstractString, Symbol})
   @ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/BPWA1/src/algebra/select.jl:15
  select(::AlgebraOfGraphics.Columns, ::Integer)
   @ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/BPWA1/src/algebra/select.jl:20
  ...

Stacktrace:
  [1] (::AlgebraOfGraphics.var"#191#196"{AlgebraOfGraphics.Columns{DimTable}})(s::Type)
    @ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/BPWA1/src/algebra/processing.jl:91
  [2] iterate
    @ ./generator.jl:48 [inlined]
  [3] _collect
    @ ./array.jl:800 [inlined]
  [4] collect_similar(cont::Array{UnionAll, 0}, itr::Base.Generator{Array{UnionAll, 0}, AlgebraOfGraphics.var"#191#196"{AlgebraOfGraphics.Columns{DimTable}}})
    @ Base ./array.jl:709
  [5] map(f::Function, A::Array{UnionAll, 0})
    @ Base ./abstractarray.jl:3371
...
Version info ```julia julia> versioninfo() Julia Version 1.11.1 Commit 8f5b7ca12ad (2024-10-16 10:53 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 16 × 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz WORD_SIZE: 64 LLVM: libLLVM-16.0.6 (ORCJIT, tigerlake) Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

(jl_mkPFYu) pkg> st
Status /tmp/jl_mkPFYu/Project.toml
[cbdf2221] AlgebraOfGraphics v0.8.13
[13f3f980] CairoMakie v0.12.15
[0703355e] DimensionalData v0.28.3

</details>
@RomeoV
Copy link
Author

RomeoV commented Nov 1, 2024

Looks like indexing with symbols instead still works though:

data(A) * mapping(:X, :Y; color = :data) * visual(Scatter) |> draw

@lazarusA
Copy link
Collaborator

lazarusA commented Nov 1, 2024

try again, like in 30 min. The new version should be out by then, which is the one used for the AoG docs.

@lazarusA lazarusA closed this as completed Nov 1, 2024
@RomeoV
Copy link
Author

RomeoV commented Nov 1, 2024

Can confirm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants