-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
DOC: clarify numpy.asarray parameter 'order' #29606
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
base: main
Are you sure you want to change the base?
Conversation
Changed description to make explicit that setting 'A' requires user to set 'copy' to 'True' to get the described behavior. Made explicit that 'A' has two cases where it acts as equivalent to setting 'F'. See 28247.
See 28247. Changed description of 'order' to make the behavior of 'A' more explicit and how to cause it to preserve non-contiguous Fortran-order. Changed description of 'C' and 'F' to clarify that output will be contiguous.
See 28247. To differentiate between 'A' and 'K', made explicit that 'A' will not ensure the output is contiguous. 'K' has more complex behavior related to flags and stride detection, but will try to keep the output as close as possible to the input.
See 28247. Made explicit that 'C' and 'F' can copy input to output, 'A' does not ensure contiguous output.
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.
Looks much clearer to me, but I'll leave to @seberg to merge. Cheers!
'C' gives a row-major layout (C-style), | ||
'F' gives a column-major layout (Fortran-style). | ||
'C' and 'F' will copy if needed to ensure the output format. | ||
'A' (any) is equivalent to 'F' if input a is non-contiguous or Fortran-contiguous, otherwise, it is equivalent to 'C'. Unlike 'C' or 'F', 'A' does not ensure that the result is contiguous. |
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.
Yeah, seems good, can you break the long line though?
Also, can you see which other places have the identical comment, we should change them all (where applicable, which might be some exceptions but not sure).
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.
Will do.
- formality question: Is it okay to change it on my repo directly (since it's just replacing ' ' with '\n') or should I do the whole process again with "change locally, spin build, spin test, spin lint, push to personal repo, create new pull request?" Or is there a procedure to alter a repo that had a push request already made?
- Did you want me to hit up anywhere that had 'order' with 'A' and 'K' args, or anywhere that had the whole
Fortran contiguous, ‘C’ otherwise ‘K’ (keep) preserve input order Defaults
string (which has line-breaks but no punctuation)?
See #28247. Made explicit that 'C' and 'F' can copy input to ensure output format, 'A' does not ensure contiguous output. Kept 'K' the same because all the stride analysis/flag-handling behavior should be extraneous to the end user.