-
-
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
Doc IndexLinear and IndexCartesian #28476
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my phone. Looks great, thanks. One nuance: you can index any array with either style---these are just signals from the developer about which one is implemented/faster.
base/indices.jl
Outdated
""" | ||
IndexLinear() | ||
|
||
Subtype of [`IndexStyle`](@ref) which specifies that the array it describes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice. Here's a shot at a set of hopefully-slightly-clearer first sentences:
Subtype of
[`IndexStyle`](@ref)
that is used to describe arrays that are optimally indexed by one linear index.
Subtype of
[`IndexStyle`](@ref)
that is used to describe arrays that are optimally indexed by a Cartesian index with the same number of indices as there are dimensions in the array.
I also have a slight preference for separating out the first sentence in a docstring as a stand-alone "summary" line (a paragraph by itself).
Thanks for the feedback, guys. I'll get on this asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it specified how offset arrays should transform between linear and Cartesian indexes? The description seems accurate for 1-based arrays.
base/indices.jl
Outdated
either linear indexing or cartesian indexing. If you decide to | ||
implement linear indexing, then you must set this trait for your array | ||
you define a new [`AbstractArray`](@ref) type, you can choose to implement | ||
either linear indexing (with [`IndexLinear`](@ref)) wor cartesian indexing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“wor cartesian” should be “or Cartesian” (w + capital)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wor
vs xor
... 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Good to go? Whoever merges, please remember to remove the |
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
* Doc IndexLinear and IndexCartesian (cherry picked from commit d15b091)
Hopefully this is ok as a summary ... definitely open to suggestions for improvement!