-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC: Fix some reference warnings #25851
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
ref: numpygh-13114 [skip cirrus] [skip azp] [skip actions]
@@ -1165,6 +1165,10 @@ User-defined data types | |||
*totype*. Any old casting function is over-written. A ``0`` is | |||
returned on success or a ``-1`` on failure. | |||
|
|||
.. c:type:: PyArray_VectorUnaryFunc |
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.
Is the indentation correct?
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 avoided using the same indentation because the rest of this section is all function definitions.
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 think the rendered indentation is correct. It seems like the actual typedef of PyArray_VectorUnaryFunc
is not documented elsewhere so maybe this could be enhanced, but on the other hand it is surprisingly difficult to figure out what the signature means. Perhaps a link to registering casting functions would be helpful on how to use this function.
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.
The function types should be documented somewhere, but I suppose the present location is a bit better than it was.
@@ -1130,6 +1134,10 @@ PyUFunc_Type and PyUFuncObject | |||
A function which resolves the types and fills an array with the dtypes | |||
for the inputs and outputs | |||
|
|||
.. c:type:: PyUFunc_TypeResolutionFunc |
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.
Indentation?
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.
PyUFunc_TypeResolutionFunc is not itself a member of the struct, so added one extra indentation.
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.
Again, the indentation is rendered correctly, but I wonder if this is the correct place for the type declaration. The only other mention I could find for PyUFunc_TypeResolutionFunc
is in NEP 40, where it is mentioned but not defined. It will default to PyUFunc_DefaultTypeResolver
, which is part of the NumPy UFUNC_API but not documented.
Thanks @F3eQnxN3RriK . I think this bit of documentation could use further improvements, but that is a different project. |
ref: gh-13114
[skip cirrus] [skip azp] [skip actions]