-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Describe problem with sentinel values for non-1 arrays #27
Conversation
Thanks. I like the discussion, but the Julep explicitly lists the issue of non-standard indices in the "out of scope" section. So either add the discussion there, or make a concrete suggestion which fits with the two general proposals and remove that mention. That may not be as hard as it sounds: we can just decide that by default all functions return 1-based linear indices, but that they will all accept a type as first parameter to get a different kind of indices. The question is, should we keep returning 1-based linear indices by default, or n-based linear indices (with arbitrary |
This runs into a problem for For any other dimensionality, it's fine. But sure, I will change it more comprehensively so that it's not "out of scope." It's such a nice Julep for discussing this troublesome family of functions, and I think it's worth laying out all the issues on the table rather than having a separate Julep just for this one issue. |
Wait, I don't think you do treat non-1 indexing; there's a section on linear vs cartesian indexes, but that's not the same thing. Can you point me to what you mean? |
I'm not sure I follow. Could you precise what you mean? I just suggested we do the same as for
Yes, I referred to that section. It doesn't deal with non-1 indices, but that's really the same issue from an API perspective AFAICT. |
We've followed a firm rule that julia> x = OffsetArray(1:9, -4:4)
OffsetArrays.OffsetArray{Int64,1,UnitRange{Int64}} with indices -4:4:
1
2
3
4
5
6
7
8
9
julia> x[1]
6 Currently we don't have a Does this help? I think that also addresses the second point as to why I see these as quite separate issues. |
I see, thanks. So we need to decide what's the best default behavior; I think it would make sense to behave like |
I'll let you decide about merging this, I just didn't want this issue to be forgotten as folks think about the redesign. |
If you don't have the time to add a full proposal to fix this, could you just insert the paragraph in the "out of scope" section for now? As I said, the list where you added it currently only contains questions which are addressed by the two proposals, which isn't the case of this one. |
fb1bb56
to
d23e102
Compare
I'm slow, but now I get it 😄. |
CC @nalimilan