JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

Type piracy with cat ? #145

Closed albop closed 5 years ago

albop commented 5 years ago

It looks like AA redefines cat on basic Vector types:

julia> using AxisArrays

julia> ll = Array{Array{Symbol,1},1}()
0-element Array{Array{Symbol,1},1}

julia> cat(ll..., dims=1)
ERROR: BoundsError: attempt to access ()
  at index [1]
Stacktrace:
 [1] getindex(::Tuple{}, ::Int64) at ./tuple.jl:24
 [2] _cat at /home/pablo/.julia/packages/AxisArrays/G6pZY/src/combine.jl:20 [inlined]
 [3] #cat#44(::Int64, ::Function) at /home/pablo/.julia/packages/AxisArrays/G6pZY/src/combine.jl:16
 [4] (::getfield(Base, Symbol("#kw##cat")))(::NamedTuple{(:dims,),Tuple{Int64}}, ::typeof(cat)) at ./none:0
 [5] top-level scope at none:0
albop commented 5 years ago

I should have said, this happens on 0.7.

iamed2 commented 5 years ago

You're right that it's redefining cat but it's cat(dims=1) that's being called.

iamed2 commented 5 years ago

It's a simple tweak, I can fix it quickly.