Repository navigation
fix(numpy): broadcast result coordinate shapes - #762
Open
peterolkhov wants to merge 1 commit into
Open
peterolkhov wants to merge 1 commit into
peterolkhov wants to merge 1 commit into
Conversation
Assisted-by: Codex:gpt-6.1-sol
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI-generated PR description, prepared with Codex (GPT-6.1 Sol, high reasoning).
Description
NumPy vector conversions can raise
IndexErrorafternp.sum, or reject broadcastable coordinate arrays such as(2, 1)and(1, 3). Compute the joint result shape withnumpy.broadcastso scalar aggregates and multidimensional coordinates convert successfully, while preserving the existing Python-scalar wrapping behavior.Adds native regressions across generic and momentum 2D/3D/4D conversions, zero-dimensional coordinates, multidimensional and empty-array broadcasts, and scalar arithmetic controls. The shape helper's doctests document the behavior.
Validation: 42 regression failures before the fix; Python 3.14 / NumPy 2.4: 4,979 tests and 119 doctests pass (16 optional skips); Python 3.11 / NumPy 1.23.5: 2,976 available tests pass (1,562 optional skips). All applicable pre-commit hooks pass. The native Sphinx HTML build succeeds with 14 Markdown-extension unknown-node warnings. GPU, ROOT, notebook execution and Dask-Awkward/JAX extras were not run.
Checklist
Before Merging