-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
DOC: Add missing macros to C-API documentation #13825
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
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 Kriti, looks good. Mostly adding the PyUfunc_
identity values that were not yet documented would be nice.
doc/source/reference/c-api.array.rst
Outdated
@@ -3466,6 +3466,10 @@ Other constants | |||
|
|||
The maximum number of dimensions allowed in arrays. | |||
|
|||
.. c:var:: NPY_MAXARGS | |||
|
|||
The maximum number of arguments that can be used in arrays. |
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 see how this one is confusing. It is the maximum number of arguments to many numpy functions. I.e. the maximum number of arrays that can be processed at once. That is most notably the iterator (which should limit things such as np.choose
).
doc/source/reference/c-api.array.rst
Outdated
@@ -3558,10 +3562,17 @@ Enumerated Types | |||
|
|||
.. c:type:: NPY_SORTKIND | |||
|
|||
A special variable-type which can take on the values :c:data:`NPY_{KIND}` | |||
where ``{KIND}`` is | |||
A special variable-type which can take on the following values |
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.
Since we are here, maybe we can add a (half) sentence repeating that it signals whichalgorithm is used for sorting. I know its pretty obvious though.
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 good, could add more text to some of them, but not necessary now, and it is a large improvement just to list everything completely!
doc/source/reference/c-api.array.rst
Outdated
@@ -3464,11 +3464,11 @@ Other constants | |||
|
|||
.. c:var:: NPY_MAXDIMS | |||
|
|||
The maximum number of dimensions allowed in arrays. | |||
The maximum number of dimensions allowed in statically allocated arrays. |
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 is true, that NPY_MAXDIMS
is mostly used for statically allocated data. But the first version was correct, it is also the maximum number of dimensions to an array (which is why it can be used for the statically allocated data).
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, I don't think this is an improvement. NPY_MAXDIMS
happens to be used internally for the length of statically-allocated dimension C-arrays. This is an implementation detail though - the meaning of this macro is "the maximum value of ndarray.ndim
", which is essentially what the description already says
Thanks Kriti! |
|
||
**QUICKSORT**, **HEAPSORT**, **MERGESORT**, **STABLESORT** | ||
Used as an alias of :c:data:`NPY_MERGESORT` and vica versa. |
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.
typo: vice, not vica
Fixes #13775