fix: make dispatch chains in numba object backend exhaustive - #736
fix: make dispatch chains in numba object backend exhaustive#736FanxinSun wants to merge 1 commit into
Conversation
Add terminal `else: raise AssertionError` branches to the dimension/groupname dispatch chains flagged by pylint E0606 (possibly-used-before-assignment). The chains are exhaustive at runtime (dimensions are always 2, 3, or 4, and isclose validates matching dimensions upstream), so the new branches are unreachable guards, matching the existing bare-AssertionError convention at the top of the module. Fixes scikit-hep#512
fedcb14 to
7c385eb
Compare
Saransh-cpp
left a comment
There was a problem hiding this comment.
Hi @FanxinSun, thanks for picking this up!
Please see #729 (comment) for my take on AI generated comments / code. I'll be happy to review this PR further if there is minimal to none AI usage (given that it is a good first issue).
Can you comment the errors we were getting on this file (the ones you fixed). That will help me review it better.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #736 +/- ##
==========================================
- Coverage 87.72% 87.68% -0.04%
==========================================
Files 96 96
Lines 11194 11199 +5
==========================================
Hits 9820 9820
- Misses 1374 1379 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @Saransh-cpp, thanks for the reply & review, and sorry for the overfix: my AI agent commited and pushed without my careful review. Apologies and please decline this thread |
Adds terminal
else: raise AssertionErrorbranches to the dimension/groupname dispatch chains invector/backends/_numba_object.pythat pylint flags as E0606 (possibly-used-before-assignment).The chains are exhaustive at runtime — dimensions are always 2, 3, or 4, and
isclosealready validates matching dimensions with anumba.TypingErrorupstream — so the new branches are unreachable guards. Bareraise AssertionErrormatches the module's existing convention for impossible states (top of the module).Verification
pylint --enable=E0606on the file: 9 warnings → 0 (score 9.70 → 9.93)tests/backends/test_numba_object.py: 45 passedFixes #512