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

Check axes not size? #9

Closed
mcabbott opened this issue Mar 16, 2020 · 1 comment · Fixed by #14
Closed

Check axes not size? #9

mcabbott opened this issue Mar 16, 2020 · 1 comment · Fixed by #14

Comments

@mcabbott
Copy link
Owner

Perhaps the first of these should be an error:

julia> stack(OffsetArray(fill(i,5), rand(-2:2)) for i in 1:10)
5×10 OffsetArray(::Array{Int64,2}, 0:4, 1:10) with eltype Int64 with indices 0:4×1:10:
 1  2  3  4  5  6  7  8  9  10
 1  2  3  4  5  6  7  8  9  10
 1  2  3  4  5  6  7  8  9  10
 1  2  3  4  5  6  7  8  9  10
 1  2  3  4  5  6  7  8  9  10

julia> rstack(OffsetArray(fill(i,5), rand(-2:2)) for i in 1:10)
9×10 OffsetArray(::Array{Int64,2}, -1:7, 1:10) with eltype Int64 with indices -1:7×1:10:
 1  0  0  4  0  6  7  8  0   0
 1  0  0  4  5  6  7  8  0  10
 1  0  0  4  5  6  7  8  0  10
 1  2  0  4  5  6  7  8  9  10
 1  2  3  4  5  6  7  8  9  10
 0  2  3  0  5  0  0  0  9  10
 0  2  3  0  0  0  0  0  9   0
 0  2  3  0  0  0  0  0  9   0
 0  0  3  0  0  0  0  0  0   0
@mcabbott
Copy link
Owner Author

Also this one:

julia> stack([OffsetArray(fill(n,4), rand(-3:3)) for n=1:10])
4×10 stack(::Array{OffsetArray{Int64,1,Array{Int64,1}},1}) with eltype Int64 with indices 3:6×Base.OneTo(10):
 1  4648430339  4648841248           4   5           6  …  4648430339           9  21474836480
 1  4992131808  4992134272           0   5           6     4992134944           9           10
 1           4           4  4648841248   5  4650911152              3           0           10
 1      563204      559108  4992134384  18  4648841248         563204  4648430339           10

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