Skip to content

API: Create PyArray_DescrProto for legacy descriptor registration #25792

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 10, 2024

Conversation

seberg
Copy link
Member

@seberg seberg commented Feb 8, 2024

First step, force users of registered dtypes to slightly change their code in order to free up changing our descr struct.

@seberg seberg requested a review from ngoldbaum February 8, 2024 15:49
@charris charris changed the title API: Create PyArray_DescrProto for legacy descriptor registration API: Create PyArray_DescrProto for legacy descriptor registration Feb 8, 2024
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.

Code changes look fine to me. Ping @WarrenWeckesser too for the perspective of a person maintaining some legacy dtypes.

We don't need to actually write new docs now, but we should either delete https://numpy.org/doc/stable/user/c-info.beyond-basics.html#user-defined-data-types or add a big warning over it saying it's a legacy API.

@seberg
Copy link
Member Author

seberg commented Feb 9, 2024

Also @jakevdp, mltypes will notice this. The updates should be very easy though (see release notes or rational changes here).

I would like to push this through very soon, though. Without this there is absolutely no way we might make itemsize an intp or add new flags in a reasonable way, and I think the changes required are simple.
(And however we do it exactly, prepare for bit-sized dtypes, which is asked for surprisingly often, even if ndarray can't store them directly due to byte strides.)

@seberg
Copy link
Member Author

seberg commented Feb 10, 2024

Rebased and added the alias also to the compat header. I will merge this once tests pass since Nathan said it looks good and it is just a bit nicer to work off main.

@seberg seberg merged commit cca589e into numpy:main Feb 10, 2024
@seberg seberg deleted the proto-descr branch February 10, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants