Repository navigation
fix: allow GCXS data of any dtype again - #1028
Conversation
Since pydata#1015, GCXS.__init__ passes `data` to the jitted _validate_gcxs_arrays, and Numba can't type float16, object or longdouble arrays, so building a GCXS from them failed, as did ufuncs that return float16 (np.sin on int8 data). The check only needs the length of `data`, so pass that instead. `data.ndim` is already checked before the call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s is Coverage can't see inside the jitted _validate_gcxs_arrays, so the lines changed there counted as uncovered. Restore the function and pass a zero-copy boolean array with the shape of `data` instead, which Numba can type for any data dtype. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3
Head branch was pushed to by a user without write access
|
Thanks for the review. codecov/patch failed because three of the four changed lines were inside the jitted The benchmarks and codecov/project checks also fail on #1026, so I left those alone. |
|
@hameerabbasi — pushed ad989c3 to fix the codecov/patch failure: the only changed source line is now in |
|
The one required check still pending is Read the Docs. Its build for ad989c3 (#35853254) was killed during The two red checks, codecov/project and benchmarks, are not marked required and fail on main as well. |
What type of PR is this? (check all applicable)
Related issues
compressed_axes=Noneambiguity inGCXS. #1015np.sinon int8 GCXS crashes) #1027What this changes
_validate_gcxs_arraysis jitted and tookdataas an argument, but it only used itsndimand length. Numba can't type float16, object or longdouble arrays, so since #1015 any GCXS with that data failed to build, and so did ufuncs that return float16 from GCXS input (np.sinon int8, uint8 or bool). The function now takesdata.shape[0]instead.GCXS.__init__already raises ifdata.ndim != 1before the call, so that check is not lost. The error messages are unchanged.New tests build a GCXS from float16, object and longdouble data, and run
np.sinon int8 GCXS. All of them fail on main and pass with this change.One side effect: 18 parametrizations of
test_reductions_float16now XPASS again. That test is markedxfailfor a float16 precision difference, so since #1015 it had been "failing" by crashing in the constructor instead, which hid this regression. I left the marker alone.pytest sparse/numba_backendlocally: 7021 passed, 97 xfailed, 57 xpassed. ruff check and ruff format pass.Checklist
This change was written with Claude (an AI assistant), which also ran the checks listed above.