Skip to content
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

Numpy 2.x causes out of bounds error for BitMaskedArray kernels #3071

Closed
ManasviGoyal opened this issue Apr 3, 2024 · 1 comment · Fixed by #3073
Closed

Numpy 2.x causes out of bounds error for BitMaskedArray kernels #3071

ManasviGoyal opened this issue Apr 3, 2024 · 1 comment · Fixed by #3073
Assignees
Labels
bug The problem described is something that must be fixed

Comments

@ManasviGoyal
Copy link
Collaborator

ManasviGoyal commented Apr 3, 2024

Version of Awkward Array

2.6.3

Description and code to reproduce

Due to the changes to promotion in Numpy 2.x, some tests for BitMaskedArray Python kernels gives:
OverflowError: Python integer 464 out of bounds for uint8

It needs to be explicitly promoted now.

@ManasviGoyal ManasviGoyal added the bug The problem described is something that must be fixed label Apr 3, 2024
@ManasviGoyal ManasviGoyal self-assigned this Apr 3, 2024
@jpivarski
Copy link
Member

Mentioned in #3064 (comment), the specific tests are the ones removed in 2bcb015, namely

awkward_BitMaskedArray_to_ByteMaskedArray test with

                {
                    "error": false,
                    "message": "",
                    "inputs": {
                        "bitmasklength": 2,
                        "frombitmask": [58, 59],
                        "lsb_order": false,
                        "validwhen": false
                    },
                    "outputs": {
                        "tobytemask": [0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1]
                    }
                }

awkward_BitMaskedArray_to_IndexedOptionArray test with

                {
                    "error": false,
                    "message": "",
                    "inputs": {
                        "bitmasklength": 2,
                        "frombitmask": [58, 59],
                        "lsb_order": false,
                        "validwhen": false
                    },
                    "outputs": {
                        "toindex": [0, 1, -1, -1, -1, 5, -1, 7, 8, 9, -1, -1, -1, 13, -1, -1]
                    }
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants