Skip to content

bpo-31754: Fix the PyBuffer Documentation - #3993

Merged
berkerpeksag merged 5 commits into
python:masterfrom
vyas45:Issue31754
Oct 15, 2017
Merged

bpo-31754: Fix the PyBuffer Documentation#3993
berkerpeksag merged 5 commits into
python:masterfrom
vyas45:Issue31754

Conversation

@vyas45

@vyas45 vyas45 commented Oct 14, 2017

Copy link
Copy Markdown
Contributor

@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@vyas45 vyas45 changed the title Issue31754: Fix the PyBuffer Documentation bpo-31754: Fix the PyBuffer Documentation Oct 14, 2017
@@ -0,0 +1 @@
Fix document entry in c-api/buffer.html. Patch by Aniket Vyas

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A news file is not needed for trivial documentation changes.

Comment thread Doc/c-api/buffer.rst Outdated


.. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char order)
.. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char order)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

First parameter of this function is named ndims:

cpython/Include/abstract.h

Lines 559 to 563 in cd195e2

PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,
Py_ssize_t *shape,
Py_ssize_t *strides,
int itemsize,
char fort);

I'd say go ahead and rename ndim to ndims.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out. Also, the last parameter is "char fort" rather than "char order" in documentation. Do you want me to change that as well ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, order should stay as-is since it's more readable. It was renamed from fortran to order in 9a2d99e#diff-77786d8cf2602a6684bccbf242e5fc1eR457

@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@vyas45

vyas45 commented Oct 14, 2017

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@vyas45

vyas45 commented Oct 15, 2017

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vyas45 for the PR, and @berkerpeksag for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 15, 2017
@bedevere-bot

Copy link
Copy Markdown

GH-4005 is a backport of this pull request to the 3.6 branch.

@berkerpeksag

Copy link
Copy Markdown
Member

Thanks, @vyas45!

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @vyas45 and @berkerpeksag, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 1b9e76ed3a055a53ca67397e928e1b408461900b 2.7

@berkerpeksag

Copy link
Copy Markdown
Member

@vyas45 do you have time to create a backport PR for 2.7?

@vyas45

vyas45 commented Oct 15, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag Sure thing ! I can work on the backport. However I am quite new to the environment, would you have some instructions on how to do so ? Thanks !

@berkerpeksag

Copy link
Copy Markdown
Member

@vyas45 basically it's the same steps for the master branch. The only difference is that you need to switch to the 2.7 branch first:

$ git checkout 2.7
# edit Doc/c-api/buffer.rst manually
# commit your changes
$ git push origin <your-branch>
# and open a PR on GitHub -- you'll need to select 2.7 as a base branch

@vyas45

vyas45 commented Oct 16, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag Thanks for the instructions! I checked out the 2.7 branch. Needed a clarification though. In 2.7 , the last argument is "char fortran" which according to your previous comment was moved to "char order" for readability.

" No, order should stay as-is since it's more readable. It was renamed from fortran to order in 9a2d99e#diff-77786d8cf2602a6684bccbf242e5fc1eR457 "

Would you like me to go ahead and change "fortran" to "order" in 2.7 ?

Thanks !

@berkerpeksag

Copy link
Copy Markdown
Member

I personally want to keep modifications to the 2.7 branch minimal so let's keep it 'fortran'.

@vyas45

vyas45 commented Oct 16, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag Thanks for the clarification. Also, just to be sure, I am keeping the changes on the first parameter (changing from "ndim" to "ndims").

Regarding committing to the 2.7 branch, I followed the instructions you mentioned. However, after making the point changes to my local branch , pushing and initiating a Pull request, I see a bunch of other changes(a lot of them) along with my changes. Is that how a backport works, being an aggregation of all backports to 2.7 or am I doing something wrong ?

Thanks !

@Mariatta

Copy link
Copy Markdown
Member

@vyas45 When creating the backport PR, you need to change the base from master to the maintenance branch (2.7).

@vyas45

vyas45 commented Oct 16, 2017

Copy link
Copy Markdown
Contributor Author

@Mariatta thanks a lot ! That worked.

@berkerpeksag

Copy link
Copy Markdown
Member

@vyas45 you can also follow the guide at https://help.github.com/articles/creating-a-pull-request-from-a-fork/

Also, just to be sure, I am keeping the changes on the first parameter (changing from "ndim" to "ndims").

That's up to you. Either way is OK for me.

@bedevere-bot

Copy link
Copy Markdown

GH-4012 is a backport of this pull request to the 2.7 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants