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

Doc IndexLinear and IndexCartesian #28476

Merged
merged 2 commits into from
Aug 13, 2018
Merged

Doc IndexLinear and IndexCartesian #28476

merged 2 commits into from
Aug 13, 2018

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Aug 6, 2018

Hopefully this is ok as a summary ... definitely open to suggestions for improvement!

@kshyatt kshyatt added docs This change adds or pertains to documentation arrays [a, r, r, a, y, s] labels Aug 6, 2018
@kshyatt kshyatt requested a review from timholy August 6, 2018 14:25
@kshyatt kshyatt changed the title Doc IndexLinear and IndexStyle Doc IndexLinear and IndexCartesian Aug 6, 2018
Copy link
Member

@timholy timholy left a 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
Copy link
Member

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).

@kshyatt
Copy link
Contributor Author

kshyatt commented Aug 7, 2018

Thanks for the feedback, guys. I'll get on this asap.

Copy link
Member

@andyferris andyferris left a 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.
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wor vs xor ... 😛

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@kshyatt
Copy link
Contributor Author

kshyatt commented Aug 8, 2018

Good to go? Whoever merges, please remember to remove the [ci skip] when you squash!

@kshyatt kshyatt merged commit d15b091 into master Aug 13, 2018
@kshyatt kshyatt deleted the ksh/index branch August 13, 2018 13:16
KristofferC pushed a commit that referenced this pull request Aug 19, 2018
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
KristofferC pushed a commit that referenced this pull request Aug 19, 2018
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
@KristofferC KristofferC mentioned this pull request Aug 19, 2018
KristofferC pushed a commit that referenced this pull request Aug 19, 2018
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
KristofferC pushed a commit that referenced this pull request Sep 8, 2018
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
KristofferC pushed a commit that referenced this pull request Sep 8, 2018
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
* Doc IndexLinear and IndexCartesian

(cherry picked from commit d15b091)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants