-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: Rearranged parts of the Indexing docs to consolidate content #19407
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
Conversation
The CI build is failing because of two reasons:
|
Hi @Mukulikaa - sorry for the delay! A couple of high-level comments:
So, here's my suggestion (but others may very well disagree!):
Of course the how-to would come in another PR, but to me it makes more sense to organize things that way. Thoughts? |
Thanks, @melissawm! I agree with all of your suggestions. I moved all the information to the reference guide doc because it was suggested here and I assumed users would prefer that. But I agree if we were to strictly follow Diataxis then we should move the doc to the Fundamentals. I am also in the process of making a list of use-cases for the how-to 🙂. |
So, right now here's what we have:
I'm wondering if it would just be better to remove the Indexing arrays section in the "N-dimensional array" page, and put that sentence directly into Indexing. Another option would be to lose the Indexing page altogether; I'm struggling to understand if this is needed after the current changes. Oh and another point: the "Indexing basics" page is not basic at all :) I'd change its title to Indexing or "Indexing on ndarrays", something like this. |
I was also thinking about this because I agree that this doc is a stub. However, I felt that having that doc clearly visible in the sidebar makes it more accessible to someone who directly refers to the reference doc instead of the user guide (experienced users maybe?). So I was thinking if we could replace the stub with Indexing routines which would link to the doc in the user guide. It will look something like the ufuncs reference doc I restructured recently.
I agree, we can change it to "Indexing on ndarrays" to avoid any clash.
I don't have any particular opinion on this so I'm happy to amend it the way everyone thinks is best! |
I am not sure if the CI failure is unrelated. |
This is fixed on
|
630f910
to
a3c72d6
Compare
Here is the rendered page. |
Hmm, I started going through the content, but on second thought maybe that should be left for a follow-on PR. This does such a great job moving the pieces around it would be a shame to delay merging it on smaller details. |
If it is easier to leave comments on this PR for the changes required, I am happy to continue the work on this PR itself. As I am actively working on this it wouldn't cause much delay I think. 🙂 |
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.
This is really impressive work @Mukulikaa , distilling the disparate info from these (heavily overlapping) documents is no small feat! I reviewed this with my main goal being to check that all of the relevant information from the two original documents (ref guide article & user guide article. For the most part I think this is satisfied - there were a few places where I thought some text/examples from one or the other document that had been dropped should be reincluded.
The only main thing that jumped out to me was the expansion of indexing types to include "single element indexing" as a top-level category. As mentioned in the specific comments, this should be folded under the "basic" indexing category. This was the only necessary change though IMO, everything else is either opinions or nits. Thanks for the excellent work here!
Thank you for your comments @rossbar! I think I omitted some examples to reduce the length of the document but I agree that they should be included if they make the concepts clearer. |
Hi @rossbar, I've tried to incorporate the changes you suggested. Let me know if there are any other suggestions! |
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.
Thanks for the iteration @Mukulikaa , you've addressed all my original comments very well - just a few more things I noticed in the updated text but otherwise this looks good to me. Excellent work!
doc/source/user/basics.indexing.rst
Outdated
.. _basic-slicing-and-indexing: | ||
|
||
Basic slicing and 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.
I would also vote to call this section Basic Indexing
- as mentioned, slices fall under the "basic indexing" term. Renaming the link target assumes that there isn't already a .. _basic-indexing
target defined elsewhere :)
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.
It hasn't been used anywhere else so I'll go ahead and change it.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
doc/source/user/basics.indexing.rst
Outdated
@@ -29,9 +29,9 @@ Note that in Python, ``x[(exp1, exp2, ..., expN)]`` is equivalent to | |||
for the former. | |||
|
|||
|
|||
.. _basic-slicing-and-indexing: | |||
.. _basic-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.
This link may be in use by others outside NumPy. Could we leave both forms with a comment "legacy link name"?
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.
I added this link in this PR itself in a previous commit because I needed it for the stub Indexing doc that was left behind in the reference guide. Since then I removed the stub completely but forgot to remove this link... So should I just remove this link altogether?
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.
Ahh, I see. If it is new and no-one needs it then it can be removed.
The latest commit which changed a link name made me start thinking about a side-effect of this refactoring: it might break existing links. I took a look at the nitpicky CI run results for internal consistenc. It seems the WARNINGS: with the word "index" in them (like the See Also section of expand_dims and missing |
Thanks @Mukulikaa. Let's put this in, we can make more changes if it turns out we broke links by rearranging things. |
Changes in Indexing in NumPy Fundamentals:
Indexing
toIndexing basics
.Changes in Indexing in API Reference:
Closes #14038
Side note: I realize it's a huge PR and will potentially be difficult to review. Please let me know if there are better ways to go about these kinds of PRs that involve re-writes and changes to multiple files 🙂.