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

Add a docstring to the constructor. #65

Closed
wants to merge 1 commit into from
Closed

Add a docstring to the constructor. #65

wants to merge 1 commit into from

Conversation

tpapp
Copy link
Contributor

@tpapp tpapp commented Jan 17, 2019

No description provided.

@tpapp
Copy link
Contributor Author

tpapp commented Jan 22, 2019

I guess it would make sense to document the constructor with offsets, too, should I do that?

@tpapp
Copy link
Contributor Author

tpapp commented Jan 24, 2019

Now that I revisit this, I am no longer sure what the constructor with indexes does. I thought it specifies the indices that the result will have, but then map(indexoffset, inds) is not the right function --- consider the pre-#67 behavior (note axes):

julia> O1 =OffsetArray(ones(3, 3), -1:1, -2:0)
OffsetArray(::Array{Float64,2}, -1:1, -2:0) with eltype Float64 with indices -1:1×-2:0:
 1.0  1.0  1.0
 1.0  1.0  1.0
 1.0  1.0  1.0

julia> O2 =OffsetArray(O1, -1:1, -2:0)
OffsetArray(OffsetArray(::Array{Float64,2}, -1:1, -2:0), -3:-1, -5:-3) with eltype Float64 with indices -3:-1×-5:-3:
 1.0  1.0  1.0
 1.0  1.0  1.0
 1.0  1.0  1.0

@timholy
Copy link
Member

timholy commented Feb 1, 2019

Ooh, you are right. The behavior you achieved in #67 is the one we want to keep, even if it means breaking stuff.

@timholy
Copy link
Member

timholy commented Jan 18, 2020

The necessary breaking changes were made in #90 and this was added as 2b77520

@timholy timholy closed this Jan 18, 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 this pull request may close these issues.

2 participants