Skip to content

MAINT: Generate the module state structs from the field lists - #32544

Merged
seberg merged 1 commit into
numpy:mainfrom
prathamhole14:module_state_generated_fields
Sep 9, 2026
Merged

seberg merged 1 commit into
numpy:mainfrom
prathamhole14:module_state_generated_fields

Conversation

@prathamhole14

Copy link
Copy Markdown
Member

PR summary

Addresses @seberg's review comment #31992 (comment) about avoiding the duplication.

AI Disclosure

In this PR almost everything is done by claude opus 5 but I understand the changes and verified them myself.

@prathamhole14
prathamhole14 force-pushed the module_state_generated_fields branch 3 times, most recently from 6354a67 to fae7610 Compare September 8, 2026 18:30
@prathamhole14
prathamhole14 marked this pull request as ready for review September 8, 2026 18:30

@ngoldbaum ngoldbaum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, I'm very happy to delete a bunch of code!

I have one request to preserve comments you're deleting

@prathamhole14
prathamhole14 force-pushed the module_state_generated_fields branch from fae7610 to 63a2125 Compare September 9, 2026 03:23

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, and thanks for restoring the comments as well.

@seberg
seberg merged commit 88ddb98 into numpy:main Sep 9, 2026
91 checks passed
@prathamhole14
prathamhole14 deleted the module_state_generated_fields branch September 9, 2026 11:54
SwayamInSync added a commit to SwayamInSync/numpy that referenced this pull request Sep 16, 2026
Conflict in numpy/_core/src/common/npy_import.h: numpygh-32544 now generates
the members of npy_runtime_imports_struct from NPY_RUNTIME_IMPORTS_FIELDS
via NPY_DECLARE_PYOBJECT_FIELDS, so the explicit member list is gone.
Resolved by taking main's generated declaration and dropping the two
explicit `_dot_fallback`/`_vdot_fallback` members this branch had added;
they are now generated from the F() entries already present in
module_state_fields.h.
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