Skip to content

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

Merged
merged 1 commit into from
Feb 20, 2024
Merged

DOC: Fix some reference warnings #25851

merged 1 commit into from
Feb 20, 2024

Conversation

koyuki7w
Copy link
Contributor

ref: gh-13114

[skip cirrus] [skip azp] [skip actions]

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

Choose a reason for hiding this comment

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

Is the indentation correct?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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

Choose a reason for hiding this comment

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

Indentation?

Copy link
Contributor Author

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.

Copy link
Member

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.

@charris charris merged commit 44f00fc into numpy:main Feb 20, 2024
@charris
Copy link
Member

charris commented Feb 20, 2024

Thanks @F3eQnxN3RriK . I think this bit of documentation could use further improvements, but that is a different project.

@koyuki7w koyuki7w deleted the doc-patch-1 branch February 20, 2024 03:59
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.

3 participants