Content-Length: 431167 | pFad | https://github.com/numpy/numpy/pull/27582

D4 DOC: Fix some out-of-data struct in c-api types-and-structures by fengluoqiuwu · Pull Request #27582 · numpy/numpy · GitHub
Skip to content

DOC: Fix some out-of-data struct in c-api types-and-structures #27582

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

fengluoqiuwu
Copy link
Contributor

@fengluoqiuwu fengluoqiuwu commented Oct 17, 2024

DOC: Update C-API docs

  • Moved members from PyArrayObject to PyArrayObject_fields.
  • Added documentation for mem_handler and _buffer_info.
  • Reordered function sequence to match the code for consistency.
  • Updated PyArray_Descr metadata field and added npy_hash_t documentation.
  • Fixed discrepancies in PyArray_ArrFuncs and PyUFuncObject.

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

@fengluoqiuwu
Copy link
Contributor Author

Hi,

This is my first time submitting a pull request on GitHub, and I apologize for any mistakes made. I added [skip azp] to the commit message, but it seems that all tests still ran. I created this pull request from my forked repository using the GitHub web interface.

Could someone guide me on how to properly use [skip azp] when creating a pull request from GitHub to ensure the tests are skipped?

Thank you for your help!

@ngoldbaum
Copy link
Member

You need to include [skip azp] [skip actions] [skip cirrus] to skip all the non-docs tests.

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! It's easy to lose the forest for the trees when we're working on the C API and forget to update the docs.

@ngoldbaum
Copy link
Member

Nope, that is before my time even :)

Sorry! That was me being careless and misunderstanding. I thought this was referring to the ArrFuncs API transition for NumPy 2.0...

@fengluoqiuwu
Copy link
Contributor Author

I don't think this is correct. It holds references to "legacy" functionality.
I thought this was referring to the ArrFuncs API transition for NumPy 2.0...

If you are referring to ArrFuncs, I believe that even though it holds references to "legacy" functionality, it is still neccessary to correct any errors within it as long as it remains in the documentation.

@ngoldbaum
Copy link
Member

I agree.

Copy link
Member

@mattip mattip left a comment

Choose a reason for hiding this comment

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

Nice tweak of the c docs. I had a few small suggestions, what do you think?


An implementation detail for accessing the :c:data:`PyArrayObject` struct.
You should use :c:data:`PyArrayObject` to ensure code compatibility and stability.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should document this internal struct in the documentation of public structures. We hid it on purpose. We could have internal documentation that could document this and other structs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you referring to PyArrayObject_fields? While it's true that this internal struct is not part of the public API, it can still be accessed via:

#include <numpy/arrayobject.h>
int main() {
    PyArrayObject_fields * a;
}

Given that it can be accessed, I believe it might be helpful to at least provide some guidance to users. We could mention its existence with a clear note advising against direct usage, and suggest the appropriate alternatives that should be used instead. This way, users are informed without inadvertently encouraging misuse of internal structures.

@charris
Copy link
Member

charris commented May 10, 2025

close/reopen

@charris charris closed this May 10, 2025
@github-project-automation github-project-automation bot moved this from Awaiting a code review to Completed in NumPy first-time contributor PRs May 10, 2025
@charris charris reopened this May 10, 2025
@melissawm melissawm moved this from Completed to Pending authors' response in NumPy first-time contributor PRs May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending authors' response
Development

Successfully merging this pull request may close these issues.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/numpy/numpy/pull/27582

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy