As the title says, callind dropdims surprisingly raises a methoderror, while e.g. sum works OK:
using AxisArrays
a = AxisArray(rand(1, 20), :a, :b)
sum(a, dims=Axis{:a}) # works
dropdims(a, dims=Axis{:a}) # raises 'method may be too new'
The exception is, in full:
MethodError: no method matching axisdim(::Type{AxisArray{Float64,2,Array{Float64,2},Tuple{Axis{:a,Base.OneTo{Int64}},Axis{:b,Base.OneTo{Int64}}}}}, ::Type{Axis{:a,T} where T})
The applicable method may be too new: running in world age 37030, while current world is 40852.
I did find some discussions about this kind of error in general, but cannot get what’s the reason in this case and how to fix it. Not even sure if it’s a bug somewhere, or I should execute something before?
MethodError: no method matching axisdim(::Type{AxisArray{Float64,2,Array{Float64,2},Tuple{Axis{:a,Base.OneTo{Int64}},Axis{:b,Base.OneTo{Int64}}}}}, ::Type{Axis{:a,T} where T})
The applicable method may be too new: running in world age 37030, while current world is 40852.
Closest candidates are:
axisdim(::Type{AxisArray{T,N,D,Ax}}, ::Type{#s5651} where #s5651<:(Axis{name,S} where S)) where {T, N, D, Ax, name} at /home/aplavin/.julia/packages/AxisArrays/G6pZY/src/core.jl:281 (method too new to be called from this world context.)
axisdim(!Matched::AxisArray, ::Type{Ax<:Axis}) where Ax<:Axis at /home/aplavin/.julia/packages/AxisArrays/G6pZY/src/core.jl:275
axisdim(!Matched::ImageAxes.StreamingContainer, ::Type{Axis{name,T} where T}) where name at /home/aplavin/.julia/packages/ImageAxes/l0FE8/src/ImageAxes.jl:251 (method too new to be called from this world context.)
in top-level scope at [base/none](#)
in at [base/none](#)
in #dropdims#25 at [AxisArrays/G6pZY/src/core.jl:458](#)
in _dropdims at [AxisArrays/G6pZY/src/core.jl:466](#)
in at [base/boot.jl:506](#)
in #s5651#7 at [AxisArrays/G6pZY/src/core.jl:275](#)