Repository navigation
Conversation
`save_array` rejects anything that is not `NDArrayLike` before it reaches `np.isscalar(arr)`. numpy scalars lack `__len__` and `__setitem__`, so they never pass the protocol check, and the `np.array(arr)` fallback was dead. numpy 2.5.4 changed the `np.isscalar` stub from `TypeGuard` to `TypeIs`, which lets mypy intersect the narrowed `NDArrayLike` with the scalar union and report the branch as unreachable. Delete it and pin the error path. Assisted-by: ClaudeCode:claude-fable-5-1
d-v-b
marked this pull request as ready for review
October 22, 2026 20:04
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4554 +/- ##
==========================================
+ Coverage 94.71% 94.72% +0.01%
==========================================
Files 94 94
Lines 13663 13661 -2
==========================================
Hits 12941 12941
+ Misses 722 720 -2
🚀 New features to boost your workflow:
|
Assisted-by: ClaudeCode:claude-opus-5-5
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.
This PR avoids an unnecessary branch in
save_array, and thereby makes that routine pass type checking on newer versions of numpy, thereby avoiding this lint failure which occurred during CI for an automatic dependency bump PR.Here are claude's impressions:
🤖 Ai text 🤖
save_arrayrejects anything that is notNDArrayLikebefore it reachesnp.isscalar(arr). numpy scalars lack__len__and__setitem__, so they never pass the protocol check, and thenp.array(arr)fallback was dead.numpy 2.5.4 changed the
np.isscalarstub fromTypeGuardtoTypeIs, which lets mypy intersect the narrowedNDArrayLikewith the scalar union and report the branch as unreachable. Delete it and pin the error path.Assisted-by: ClaudeCode:claude-fable-5-1
Author attestation
TODO
docs/user-guide/*.mdchanges/