Skip to content

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

Merged
merged 2 commits into from
Jun 30, 2019
Merged

Conversation

kritisingh1
Copy link
Member

Fixes #13775

Copy link
Member

@seberg seberg left a 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.

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

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

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

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.

@seberg seberg self-requested a review June 25, 2019 16:50
@charris charris changed the title DOC: Adds missing macros in C-API documentation DOC: Add missing macros to C-API documentation Jun 25, 2019
Copy link
Member

@seberg seberg left a 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!

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

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

Copy link
Member

@eric-wieser eric-wieser Jun 29, 2019

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

@seberg
Copy link
Member

seberg commented Jun 30, 2019

Thanks Kriti!

@seberg seberg merged commit b4105bf into numpy:master Jun 30, 2019

**QUICKSORT**, **HEAPSORT**, **MERGESORT**, **STABLESORT**
Used as an alias of :c:data:`NPY_MERGESORT` and vica versa.
Copy link
Member

Choose a reason for hiding this comment

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

typo: vice, not vica

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

Successfully merging this pull request may close these issues.

DOC: Missing macros in C structs documentation
4 participants