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

permute dims, dispatch correctly on DD #328

Closed
lazarusA opened this issue Sep 14, 2023 · 1 comment · Fixed by #359
Closed

permute dims, dispatch correctly on DD #328

lazarusA opened this issue Sep 14, 2023 · 1 comment · Fixed by #359

Comments

@lazarusA
Copy link
Collaborator

As of the current state:

(DD_test) pkg> st
Status `~/Desktop/tmp/DD_test/Project.toml`
  [0703355e] DimensionalData v0.24.14 `https://github.com/rafaqz/DimensionalData.jl.git#main`
  [e9467ef8] GLMakie v0.8.9
  [c21b50f5] YAXArrays v0.5.0 `https://github.com/JuliaDataCubes/YAXArrays.jl.git#master`

the following fails:

using GLMakie, DimensionalData
using YAXArrays

a = YAXArray(rand(10,10)) #|> DimArray
heatmap(a)
ERROR: MethodError: no method matching getindex(::Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, ::X{Colon})

Closest candidates are:
  getindex(::Tuple, ::Int64)
   @ Base tuple.jl:29
  getindex(::Tuple, ::Integer)
   @ Base tuple.jl:30
  getindex(::Tuple, ::Colon)
   @ Base tuple.jl:33
  ...

Stacktrace:
 [1] getindex
   @ ./tuple.jl:31 [inlined]
 [2] permutedims(c::YAXArray{Float64, 2, Matrix{Float64}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, p::Tuple{X{Colon}, Y{Colon}})
   @ YAXArrays.Cubes ~/.julia/packages/YAXArrays/X0zci/src/Cubes/Cubes.jl:176
 [3] _permute_xyz(A::YAXArray{Float64, 2, Matrix{Float64}, Tuple{Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, replacements::Tuple{})
   @ DimensionalDataMakie ~/.julia/packages/DimensionalData/TxYJV/ext/DimensionalDataMakie.jl:442
 [4] _prepare_for_makie(A::YAXArray{Float64, 2, Matrix{Float64}, Tuple{Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, replacements::Tuple{})
   @ DimensionalDataMakie ~/.julia/packages/DimensionalData/TxYJV/ext/DimensionalDataMakie.jl:431
 [5] _surface2(A::YAXArray{Float64, 2, Matrix{Float64}, Tuple{Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, replacements::Tuple{})
   @ DimensionalDataMakie ~/.julia/packages/DimensionalData/TxYJV/ext/DimensionalDataMakie.jl:165
 [6] heatmap(A::YAXArray{Float64, 2, Matrix{Float64}, Tuple{Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}; x::Nothing, y::Nothing, colorbarkw::NamedTuple{(), Tuple{}}, attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ DimensionalDataMakie ~/.julia/packages/DimensionalData/TxYJV/ext/DimensionalDataMakie.jl:134
 [7] heatmap(A::YAXArray{Float64, 2, Matrix{Float64}, Tuple{Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}})
   @ DimensionalDataMakie ~/.julia/packages/DimensionalData/TxYJV/ext/DimensionalDataMakie.jl:130
 [8] top-level scope
   @ ~/Desktop/tmp/DD_test/test_yax.jl:5
@lazarusA
Copy link
Collaborator Author

bump @felixcremer

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

Successfully merging a pull request may close this issue.

1 participant