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

show method errors with view with non standard indices #31641

Closed
piever opened this issue Apr 7, 2019 · 2 comments · Fixed by #31642
Closed

show method errors with view with non standard indices #31641

piever opened this issue Apr 7, 2019 · 2 comments · Fixed by #31642

Comments

@piever
Copy link
Contributor

piever commented Apr 7, 2019

On Julia-1.1 (but master seems to have the same issue) one can take a view with offset indices. That returns the correct result, but the show method (with :limit => true) errors:

julia> using OffsetArrays

julia> s = rand(1000);

julia> i = OffsetArray(400:900, 400:900);

julia> axes(i)
(Base.IdentityUnitRange(400:900),)

julia> view(s, i)
view(::Array{Float64,1}, Error showing value of type SubArray{Float64,1,Array{Float64,1},Tuple{OffsetArray{Int64,1,UnitRange{Int64}}},false}:
ERROR: BoundsError: attempt to access Base.IdentityUnitRange{UnitRange{Int64}} with indices 400:900 at index [1]
@timholy
Copy link
Member

timholy commented Apr 7, 2019

Thanks for the report. Triggered only under conditions where length(v) > 20, :limit=>true, ndims==1. Fix in #31642.

@piever
Copy link
Contributor Author

piever commented Apr 7, 2019

Thank you for the quick fix!

KristofferC pushed a commit that referenced this issue Apr 15, 2019
KristofferC pushed a commit that referenced this issue Apr 17, 2019
KristofferC pushed a commit that referenced this issue Apr 20, 2019
KristofferC pushed a commit that referenced this issue Feb 20, 2020
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.

2 participants