-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: Allow any index type in nonscalar indexing #12567
Conversation
Yeah, let's wait on this for 0.4; I worry about extending indexing semantics right before a release, and Arraymagedon sounds like the perfect time to play with this 😄. |
Also, let's benchmark the sh** out of stuff that changes the indexing methods because it seems to be easy to get performance regressions by touching that part of the code base. |
Remove deprecated support for indexing with floating point numbers
a40f21f
to
31002ea
Compare
I knew I'd read about this somewhere! :) I just want to bump this and check the status. Still in the scope of 0.5? From what I can tell, this is blocking Interpolations.jl from fully utilizing the power of the indexing fallbacks for |
This is a fairly drastic change that abuses generated functions in order to express a form of dispatch that would totally break the decidability of subtyping if we were able to express it as a normal method signature ("at least one vararg is I think we should take small steps toward this. #13614 was something I missed when I created this PR… and it already gets us most of the way here. Here's what I think should be the remaining steps for 0.5:
I believe that will cover the interpolations use-cases, yes? |
Yes, I believe so. It's really only the fallbacks that affect Interpolations.jl at the moment - we make sure we never index into the underlying array with anything other than Leaning on #13614 definitely sounds like a good idea. Unwrapping mutliple indices into mutliple single-point index operations was exactly what I imagined those fallbacks would eventually do when we discussed this before, so I'm all for it :) |
Referencing JuliaMath/Interpolations.jl#24 here, so I get a link with a badge indicating the status of this PR there :) |
Superseded by #19730. With that patch, any array can customize it's indexing behaviors very easily and extensibly. For example, to support non-scalar indexing with any |
I'm posting this to point an arrow towards where I think the array indexing fallbacks will go. I'm seeking a discussion on what deserves to be changed before 0.4 is branched.
Here's what this enables:
Here's what I think should occur before 0.4 branches:
in_bounds
, we can at least make it easier to extend checkbounds for a custom type, even if it's still undocumented for custom array types to provide custom index-in-bounds checks.Here's why the rest of this might need to wait, but if folks are gung-ho I can work to mitigate some of these concerns:
to_index
, which, while not documented or exported, does get used outside of base.