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

ERROR: ArgumentError: the length of each axis must match the corresponding size of data #590

Closed
mdhe1248 opened this issue Feb 17, 2017 · 4 comments

Comments

@mdhe1248
Copy link

I was just following the examples in the Images document.
I obtained the error when I used AxisArray:

julia> using Images, Unitful, AxisArrays
julia> using Unitful: mm, s

julia> AxisArray(rand(256,256,100,50), (:x, :y, :z, :time), (0.4mm, 0.4mm, 1mm, 2s))
ERROR: ArgumentError: the length of each axis must match the corresponding size of data
 in AxisArrays.AxisArray{T,N,D,Ax}(::Array{Float64,4}, ::Tuple{AxisArrays.Axis{:x,StepRange{Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Float64, Dimensions:{𝐋}, Units:{mm}}}},AxisArrays.Axis{:y,StepRange{Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Float64, Dimensions:{𝐋}, Units:{mm}}}},AxisArrays.Axis{:z,StepRange{Quantity{Int64, Dimensions:{𝐋}, Units:{mm}},Quantity{Int64, Dimensions:{𝐋}, Units:{mm}}}},AxisArrays.Axis{:time,StepRange{Quantity{Int64, Dimensions:{𝐓}, Units:{s}},Quantity{Int64, Dimensions:{𝐓}, Units:{s}}}}}) at /home/donghoon/.julia/v0.5/AxisArrays/src/core.jl:178                                                                                             
 in AxisArrays.AxisArray{T,N,D,Ax}(::Array{Float64,4}, ::AxisArrays.Axis{:x,StepRange{Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Float64, Dimensions:{𝐋}, Units:{mm}}}}, ::AxisArrays.Axis{:y,StepRange{Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Float64, Dimensions:{𝐋}, Units:{mm}}}}, ::AxisArrays.Axis{:z,StepRange{Quantity{Int64, Dimensions:{𝐋}, Units:{mm}},Quantity{Int64, Dimensions:{𝐋}, Units:{mm}}}}, ::AxisArrays.Axis{:time,StepRange{Quantity{Int64, Dimensions:{𝐓}, Units:{s}},Quantity{Int64, Dimensions:{𝐓}, Units:{s}}}}) at /home/donghoon/.julia/v0.5/AxisArrays/src/core.jl:176                                                                                           
 in AxisArrays.AxisArray{T,N,D,Ax}(::Array{Float64,4}, ::Tuple{Symbol,Symbol,Symbol,Symbol}, ::Tuple{Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Float64, Dimensions:{𝐋}, Units:{mm}},Quantity{Int64, Dimensions:{𝐋}, Units:{mm}},Quantity{Int64, Dimensions:{𝐓}, Units:{s}}}) at /home/donghoon/.julia/v0.5/AxisArrays/src/core.jl:207    
@timholy
Copy link
Member

timholy commented Feb 17, 2017

Try Pkg.checkout("Unitful"). In Julia 0.5, it's error-prone to construct ranges of Unitful objects, so recent work in Unitful now exploits the Ranges.jl package to try to help resolve these problems. In Julia 0.6, ranges have been redesigned (JuliaLang/julia#18777) and should make this much easier.

@ajkeller34, maybe we could get a new tag?

@ajkeller34
Copy link

I'm eager to tag a new release, but have been holding back since julia 0.6 is so close to stabilizing and it would be nice to see the next release work properly on 0.6.0. I can tag one if its urgent though.

@timholy
Copy link
Member

timholy commented Feb 17, 2017

Not urgent, so if you want to wait that's fine. The argument to tag is that this bug has already been reported twice.

Have you set up attobot? It makes tagging easier. I'm starting to tag packages sometimes after single commits (depends on the commit, of course).

@timholy
Copy link
Member

timholy commented Feb 24, 2017

Fixed by the new Unitful tags. Thanks a ton, @ajkeller34!

@timholy timholy closed this as completed Feb 24, 2017
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

3 participants